DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	okl-plv@napatech.com, Christian Koue Muf <ckm@napatech.com>,
	Serhii Iliushyk <sil-plv@napatech.com>
Subject: [PATCH] ntnic: remove unnecessary null free check
Date: Tue, 22 Oct 2024 22:47:38 -0700	[thread overview]
Message-ID: <20241023054738.528445-1-stephen@networkplumber.org> (raw)

No need for a if() check before calling free() since NULL is
allowed. Found by nullfree.cocci.

Fixes: 1d3f62a0c4f1 ("net/ntnic: add base init and deinit of flow API")
Cc: okl-plv@napatech.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/ntnic/nthw/flow_api/flow_api.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ntnic/nthw/flow_api/flow_api.c b/drivers/net/ntnic/nthw/flow_api/flow_api.c
index 34e84559eb..ea3ef65ecb 100644
--- a/drivers/net/ntnic/nthw/flow_api/flow_api.c
+++ b/drivers/net/ntnic/nthw/flow_api/flow_api.c
@@ -205,8 +205,7 @@ static void done_resource_elements(struct flow_nic_dev *ndev, enum res_type_e re
 {
 	assert(ndev);
 
-	if (ndev->res[res_type].alloc_bm)
-		free(ndev->res[res_type].alloc_bm);
+	free(ndev->res[res_type].alloc_bm);
 }
 
 static void list_insert_flow_nic(struct flow_nic_dev *ndev)
-- 
2.45.2


                 reply	other threads:[~2024-10-23  5:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20241023054738.528445-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=ckm@napatech.com \
    --cc=dev@dpdk.org \
    --cc=okl-plv@napatech.com \
    --cc=sil-plv@napatech.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;
as well as URLs for NNTP newsgroup(s).