[PATCH 1/3] bus/fslmc: remove unnecessary null check

Hemant Agrawal hemant.agrawal at oss.nxp.com
Wed Nov 13 06:01:20 CET 2024


Acked-by: Hemant Agrawal <hemant.agrawal at 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 at nxp.com
>
> Signed-off-by: Stephen Hemminger <stephen at 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;
>   }


More information about the dev mailing list