public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Junlong Wang <wang.junlong1@zte.com.cn>,
	Lijie Shan <shan.lijie@zte.com.cn>
Subject: [PATCH 3/4] net/zxdh: remove unnecessary null check
Date: Wed,  1 Apr 2026 09:40:24 -0700	[thread overview]
Message-ID: <20260401164108.201404-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20260401164108.201404-1-stephen@networkplumber.org>

No need to check for null before calling free.
Found by coccinelle script null_free.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/zxdh/zxdh_np.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/zxdh/zxdh_np.c b/drivers/net/zxdh/zxdh_np.c
index efb57e34f2..b078ec5b6c 100644
--- a/drivers/net/zxdh/zxdh_np.c
+++ b/drivers/net/zxdh/zxdh_np.c
@@ -12383,8 +12383,7 @@ zxdh_np_dtb_acl_data_clear(uint32_t dev_id, uint32_t queue_id,
 				&element_id);
 	free(data_buff);
 	free(mask_buff);
-	if (eram_buff)
-		free(eram_buff);
+	free(eram_buff);
 
 	free(p_entry_arr);
 	ZXDH_COMM_CHECK_DEV_RC(dev_id, rc, "zxdh_np_dtb_acl_dma_insert");
-- 
2.53.0


  parent reply	other threads:[~2026-04-01 16:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-01 16:40 [PATCH 0/4] remove useless null checks before free Stephen Hemminger
2026-04-01 16:40 ` [PATCH 1/4] net/ice: remove unnecessary null check Stephen Hemminger
2026-04-01 16:44   ` Bruce Richardson
2026-04-01 16:40 ` [PATCH 2/4] net/bnxt: " Stephen Hemminger
2026-04-01 16:40 ` Stephen Hemminger [this message]
2026-04-01 16:40 ` [PATCH 4/4] app/test_compress: " Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260401164108.201404-4-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=shan.lijie@zte.com.cn \
    --cc=wang.junlong1@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox