From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CEC7FA0A0A for ; Mon, 24 May 2021 11:23:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B92AB41110; Mon, 24 May 2021 11:23:54 +0200 (CEST) Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by mails.dpdk.org (Postfix) with ESMTP id 66D854003C; Mon, 24 May 2021 11:23:53 +0200 (CEST) Received: by mail-il1-f173.google.com with SMTP id m1so22634869ilg.10; Mon, 24 May 2021 02:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S13YFxYtiHi3W44KadHsMl3G+PKWfaR29GI7XDIYh20=; b=LuYdsB5RssFwjdohH5b++/f7PKqLwIHl7s0gOalvQdCffa26mTVLoWIIyCVShibF1Z ZblOACIeGTLi4E2BLcGHnj06ORWklcy23hxvilK7cRC20usi2heJVEHv3xkcRjXwUqIz cv/oGcI+CbhvTOBmzRO4tYjvsjH3d96FYa/Dbp58iTWv9ibsThYClJxgIjmgZ8XywriO LpBy6JIXZ52F5F8riaTCtLIOpgQ5urxB5ytPAwddQS+xnjOCFmr8o+HDgE+yUekMQTfx o+nneltxQ7mEiMe+VipWjfKa2QoISDfRXEQqVRHt/h28+ZeZV/mWCGStx6nVoAU+Y+ZV ZscQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S13YFxYtiHi3W44KadHsMl3G+PKWfaR29GI7XDIYh20=; b=NaRxtOxkJiatdyS+9FLBNsizqhwbfFNmgMK3/8dODU9kJnyNPXs7PZrN1zVToRNZuB hv4m9YhHhW9p+lV0SYeiSnoDEj+DL6WEvTRkBLGC//8dtxLcqJHwaucFihBPmN8IX0ua 9MiXIjID1eOXa6QhDbiFD46W3si3L9mHqgn/ys6XKKGsFwMVBM5EyivggAV5uNVGyTFO uVTWf61/8UViQKfvyVDtVRwPWLa6qsj9WKVF6TvcWqYk95lvz0iuITsm5QQlrpyRWp9M aYLTuRjfhZ9tuNcFrffm8G8yZKF9x+x5jyIKcMCF5Vb7+Z7nPmXSP/Isx2eWmNMkvER9 OUyg== X-Gm-Message-State: AOAM5318zdr9w1pbG0lFlQKspCdVqeQwSzLxM0plTFMwgoP2mCX/WS5v axDLbtA57HtlNr1G2kMzDo7tc2QEvf2UeTzdKzA= X-Google-Smtp-Source: ABdhPJwYo0fCfpEAFIyYQUVTFw176R+3Xm/vsCC38qx/C5EOdmd/wHFkAjT99uwjl9OFP+KCMuJlpuu0E2mGAfa9jEg= X-Received: by 2002:a05:6e02:1ba2:: with SMTP id n2mr17480243ili.60.1621848232810; Mon, 24 May 2021 02:23:52 -0700 (PDT) MIME-Version: 1.0 References: <20210524085850.16095-1-thierry.herbelot@6wind.com> In-Reply-To: <20210524085850.16095-1-thierry.herbelot@6wind.com> From: Jerin Jacob Date: Mon, 24 May 2021 14:53:36 +0530 Message-ID: To: Thierry Herbelot Cc: dpdk-dev , Thomas Monjalon , dpdk stable , Jerin Jacob , Kiran Kumar K Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] graph_stats: do not use a possibly NULL Pointer X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Mon, May 24, 2021 at 2:28 PM Thierry Herbelot wrote: > > Use stats only after it was checked not to be NULL. Please change the subject to graph: ...... With the above fix: Acked-by: Jerin Jacob > > Fixes: af1ae8b6a32c9 ("graph: implement stats") > Cc: stable@dpdk.org > Cc: Jerin Jacob > Cc: Kiran Kumar K > > Signed-off-by: Thierry Herbelot > --- > lib/graph/graph_stats.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/graph/graph_stats.c b/lib/graph/graph_stats.c > index 125e08d73290..a52994f0f61e 100644 > --- a/lib/graph/graph_stats.c > +++ b/lib/graph/graph_stats.c > @@ -119,8 +119,8 @@ stats_mem_init(struct cluster *cluster, > cluster_node_size = RTE_ALIGN(cluster_node_size, RTE_CACHE_LINE_SIZE); > > stats = realloc(NULL, sz); > - memset(stats, 0, sz); > if (stats) { > + memset(stats, 0, sz); > stats->fn = fn; > stats->cluster_node_size = cluster_node_size; > stats->max_nodes = 0; > -- > 2.29.2 >