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 B7A4EA0546; Tue, 25 May 2021 08:51:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 29EDC4003F; Tue, 25 May 2021 08:51:28 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 84B284003F for ; Tue, 25 May 2021 08:51:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621925485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QDLTmVMf3PsPckx9O58pZdkGIl7O2YBd4ZHNmlTnFZE=; b=gfAQtFtD9XwHCBiChZtJGxW/nAhuSrpPZAmLmDYSSNs7TQu9c25oSO5tlGf6v+S2qnEDhQ XIS5bcszIgMJY6qpY3cLssayN53HYzZu8HTxhEbw45g1ovdf8ZolbYw5rBEYn4KUqQQzqr dm5+PWhWuIQd9Z3FPQOO7jlZlpS9ifs= Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-22-QJSMeycnPKihtEzonH8ohw-1; Tue, 25 May 2021 02:51:22 -0400 X-MC-Unique: QJSMeycnPKihtEzonH8ohw-1 Received: by mail-vs1-f69.google.com with SMTP id d19-20020a0561020413b029023877d74e72so6723933vsq.15 for ; Mon, 24 May 2021 23:51:22 -0700 (PDT) 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=QDLTmVMf3PsPckx9O58pZdkGIl7O2YBd4ZHNmlTnFZE=; b=KCk5Svdb4ahNoFNwAkYE5+q3sBUS5r7inJXC8c9zekt00twD8aqHFErHk+0bwL6ZLu EYC3/5GrX4uUTXvisK5x7A9KejRpjo5oDTX3OM24zQl6oQlr8hbjXHSeNT5qiLFFOv9L n3AlMlUH8JsQ+FjrJN176P+aDDfx+6YaXj1cM30n+BcSLwErytkc94v9EPzYW3SbKASp ZUPKVUI22UoFYC6kEmKPj31zsDPuqd9yC7O/ZJlM9UhJaSHTNBn4uiGsuPeOJynpQn+Z UbbCROCkIUTzfbnj920kN2cdUJkH0qIXOjV6iIUHbETN7tof+4AiFziKVjXivz6k4RBq Ixbw== X-Gm-Message-State: AOAM531GPVZw8xO4Xnn7ZpgV8PzaHhkeYWIbS/VPM6dkn220uculMotv SMzaUu9wCGKcXNtpIKpdgKv08rEkCSqOdcPdmvfaLcSHElJ09irKqspMPsUaedvoF0wR+5ExxlI dlw7rCIFj0jqDAdqZKUE= X-Received: by 2002:a67:c810:: with SMTP id u16mr25082828vsk.10.1621925481876; Mon, 24 May 2021 23:51:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1K53vbLKHq8TeMOG4/ncSHBS8fSbWcV+ZEfU2UvkB24KG1wDz7xfYCxkk46QoMDBA23xJ8hsKcHCkrf8vclY= X-Received: by 2002:a67:c810:: with SMTP id u16mr25082822vsk.10.1621925481631; Mon, 24 May 2021 23:51:21 -0700 (PDT) MIME-Version: 1.0 References: <20210524085850.16095-1-thierry.herbelot@6wind.com> <20210524093136.20525-1-thierry.herbelot@6wind.com> In-Reply-To: <20210524093136.20525-1-thierry.herbelot@6wind.com> From: David Marchand Date: Tue, 25 May 2021 08:51:10 +0200 Message-ID: To: Thierry Herbelot Cc: dev , Thomas Monjalon , dpdk stable , Jerin Jacob , Kiran Kumar K Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] graph: do not use a possibly NULL Pointer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, May 24, 2021 at 11:31 AM Thierry Herbelot wrote: > > Use stats only after it was checked not to be NULL. > > Fixes: af1ae8b6a32c9 ("graph: implement stats") > Cc: stable@dpdk.org > Cc: Jerin Jacob > Cc: Kiran Kumar K > > Signed-off-by: Thierry Herbelot > -- > V2: reword patch title > --- > 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; Please update your patches status in patchwork when submitting new revisions. Besides, the same fix had been posted by Min Hu: http://patchwork.dpdk.org/project/dpdk/patch/1620285387-42792-3-git-send-email-humin29@huawei.com/ -- David Marchand