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>,
	jun.yang@nxp.com, Hemant Agrawal <hemant.agrawal@nxp.com>,
	Sachin Saxena <sachin.saxena@nxp.com>
Subject: [PATCH 1/3] bus/fslmc: remove unnecessary null check
Date: Tue, 12 Nov 2024 09:38:01 -0800	[thread overview]
Message-ID: <20241112173833.323934-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20241112173833.323934-1-stephen@networkplumber.org>

No need for check for null before calling free().
Caught by nullfree.cocci script.

Fixes: 57cb02edf122 ("bus/fslmc: enhance MC VFIO multi-process support")
Cc: jun.yang@nxp.com

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

diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index c581dcc4e2..7a584b9280 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -557,8 +557,7 @@ fslmc_vfio_open_container_fd(void)
 	return vfio_container_fd;
 
 err_exit:
-	if (mp_reply.msgs)
-		free(mp_reply.msgs);
+	free(mp_reply.msgs);
 	DPAA2_BUS_ERR("Open container fd err(%d)", ret);
 	return ret;
 }
-- 
2.45.2


  reply	other threads:[~2024-11-12 17:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-12 17:38 [PATCH 0/3] unnecessary checks for null Stephen Hemminger
2024-11-12 17:38 ` Stephen Hemminger [this message]
2024-11-13  5:01   ` [PATCH 1/3] bus/fslmc: remove unnecessary null check Hemant Agrawal
2024-11-12 17:38 ` [PATCH 2/3] net/dpaa2: remove unnecessary check for null before rte_free Stephen Hemminger
2024-11-13  5:01   ` Hemant Agrawal
2024-11-12 17:38 ` [PATCH 3/3] net/ntnic: remove unnecessary check for null before free Stephen Hemminger
2024-11-13  1:25 ` [PATCH 0/3] unnecessary checks for null Ferruh Yigit
2024-11-13  4:56   ` 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=20241112173833.323934-2-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=jun.yang@nxp.com \
    --cc=sachin.saxena@nxp.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).