Re: [PATCH v2 -next] media: atomisp: Remove unneeded if-null-free check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 02, 2021 at 09:45:47AM +0800, Zheng Yongjun wrote:
> Eliminate the following coccicheck warning:
> 
> drivers/staging/media/atomisp/pci/sh_css_firmware.c:367:4-10: WARNING:
> NULL check before some freeing functions is not needed.
> drivers/staging/media/atomisp/pci/sh_css_firmware.c:369:4-10: WARNING:
> NULL check before some freeing functions is not needed.
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@xxxxxxxxxx>
> ---
>  drivers/staging/media/atomisp/pci/sh_css_firmware.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/sh_css_firmware.c b/drivers/staging/media/atomisp/pci/sh_css_firmware.c
> index f4ce8ace9d50..5301cc014c7e 100644
> --- a/drivers/staging/media/atomisp/pci/sh_css_firmware.c
> +++ b/drivers/staging/media/atomisp/pci/sh_css_firmware.c
> @@ -363,10 +363,8 @@ void sh_css_unload_firmware(void)
>  		unsigned int i = 0;
>  
>  		for (i = 0; i < sh_css_num_binaries; i++) {
> -			if (fw_minibuffer[i].name)
> -				kfree((void *)fw_minibuffer[i].name);
> -			if (fw_minibuffer[i].buffer)
> -				kvfree(fw_minibuffer[i].buffer);
> +			kfree((void *)fw_minibuffer[i].name);

Sorry, I should have mentioned this.  Remove the cast as well.

			kfree(fw_minibuffer[i].name);

regards,
dan carpenter

> +			kvfree(fw_minibuffer[i].buffer);
>  		}




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux