DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@oss.nxp.com>
To: Stephen Hemminger <stephen@networkplumber.org>, dev@dpdk.org
Cc: jun.yang@nxp.com, Hemant Agrawal <hemant.agrawal@nxp.com>,
	Sachin Saxena <sachin.saxena@nxp.com>
Subject: Re: [PATCH 1/3] bus/fslmc: remove unnecessary null check
Date: Wed, 13 Nov 2024 10:31:20 +0530	[thread overview]
Message-ID: <658fb317-ef84-4abd-4442-d89ebd6d36f9@oss.nxp.com> (raw)
In-Reply-To: <20241112173833.323934-2-stephen@networkplumber.org>

Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

On 12-11-2024 23:08, Stephen Hemminger wrote:
> 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;
>   }

  reply	other threads:[~2024-11-13  5:01 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 ` [PATCH 1/3] bus/fslmc: remove unnecessary null check Stephen Hemminger
2024-11-13  5:01   ` Hemant Agrawal [this message]
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=658fb317-ef84-4abd-4442-d89ebd6d36f9@oss.nxp.com \
    --to=hemant.agrawal@oss.nxp.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=jun.yang@nxp.com \
    --cc=sachin.saxena@nxp.com \
    --cc=stephen@networkplumber.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 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).