From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Jeroen de Borst <jeroendb@google.com>,
Joshua Washington <joshwash@google.com>
Subject: [PATCH 2/3] net/gve: remove unnecessary check for NULL
Date: Tue, 28 Jul 2026 07:11:44 -0700 [thread overview]
Message-ID: <20260728141229.93878-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20260728141229.93878-1-stephen@networkplumber.org>
Checking for NULL before calling rte_free is unnecessary.
Found by cocci/nullfree.cocci script.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/gve/gve_rx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c
index 567b82d020..932293ddad 100644
--- a/drivers/net/gve/gve_rx.c
+++ b/drivers/net/gve/gve_rx.c
@@ -205,8 +205,9 @@ gve_rx_burst(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
if (gve_rx(rxq, rxd, rx_id)) {
if (!ctx->drop_pkt)
rx_pkts[nb_rx++] = ctx->mbuf_head;
- else if (ctx->mbuf_head != NULL)
+ else {
rte_pktmbuf_free(ctx->mbuf_head);
+ }
rxq->nb_avail += ctx->total_frags;
gve_rx_ctx_clear(ctx);
}
--
2.53.0
next prev parent reply other threads:[~2026-07-28 14:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 14:11 [PATCH 0/3] unnecessary null checks Stephen Hemminger
2026-07-28 14:11 ` [PATCH 1/3] net/sxe2: remove unnecessary checks Stephen Hemminger
2026-07-28 14:11 ` Stephen Hemminger [this message]
2026-07-28 14:11 ` [PATCH 3/3] ml/cnxk: remove unnecessary NULL check 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=20260728141229.93878-3-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=jeroendb@google.com \
--cc=joshwash@google.com \
/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