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 8A713A0547 for ; Tue, 25 May 2021 08:51:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6CBC0410E4; Tue, 25 May 2021 08:51:29 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 60BCA4003E 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-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-1-N4qKGGggM6urL1YgT0461A-1; Tue, 25 May 2021 02:51:23 -0400 X-MC-Unique: N4qKGGggM6urL1YgT0461A-1 Received: by mail-vk1-f198.google.com with SMTP id e8-20020ac5c7c80000b02901fc7f94b3a7so4695894vkn.6 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=Ag5X0cZejgLOOYr/8xse//rdmYlaGu42RLdNpCd5u0uxiKwFgU1Hlg6dfK3KELmP3k F1y2pN+UBsV+WsctTrLKF0wzGu+y6chRJ1fpMb06Zey3/QtbQDgLVM6YpVb+w3Lf/6jT oolFgPl5LtbzRz00zysE3nCSJzQIVLgTW+bndS0SWtjvX6WaYkF+PlHeP26lSlBD/qIP HFwIOsuO44RmKHE/yI8s19EUZkPMQtK2KSlETr4IwPwDs2OymEez4JaY6fIQYxMyavXX D/rEU6g4WDrfPQ/TYNCVbPX4s9GNcoLM2YBpHGjWL/M0/M4Lrf2e5mpuUx85Hr/7Hl0m Vprw== X-Gm-Message-State: AOAM53132HdcR49CQKbryGQbzhfK34V2ngIcpVWnwkXKlfTLC78sIieu rrK9LSIVLw3bpKcjpGffoeM5SXx+N5vpR9MYReJRkRG/LNBTKBdrKjNZT+zIiK0aQH/YtEYRPrb GpE/WPWx2ctcav8lcikwa7sE= X-Received: by 2002:a67:c810:: with SMTP id u16mr25082827vsk.10.1621925481875; 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-stable] [dpdk-dev] [PATCH v2] graph: 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 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