All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH] test: remove unneeded null check before free
Date: Fri,  2 Oct 2026 10:17:07 -0700	[thread overview]
Message-ID: <20261002171707.928034-1-stephen@networkplumber.org> (raw)

Found by devtools/null_free.cocci.

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

diff --git a/app/test/test_cksum.c b/app/test/test_cksum.c
index 73f2511731..d94539820a 100644
--- a/app/test/test_cksum.c
+++ b/app/test/test_cksum.c
@@ -320,8 +320,7 @@ test_l4_cksum_mbuf_chain(struct rte_mempool *pktmbuf_pool, const char *pktdata,
 	return 0;
 
 fail:
-	if (m_hdr)
-		rte_pktmbuf_free(m_hdr);
+	rte_pktmbuf_free(m_hdr);
 
 	return -1;
 }
-- 
2.53.0


             reply	other threads:[~2026-10-02 17:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 17:17 Stephen Hemminger [this message]
2026-10-03  7:25 ` [PATCH] test: remove unneeded null check before free Marat Khalili
2026-10-03 16:00   ` 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=20261002171707.928034-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.