Search Linux Wireless

Re: [PATCH] staging: wfx: Remove redundant NULL check before release_firmware() call

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

 



On Monday 6 June 2022 03:42:37 CEST cgel.zte@xxxxxxxxx wrote:
> From: Minghao Chi <chi.minghao@xxxxxxxxxx>
> 
> release_firmware() checks for NULL pointers internally so checking
> before calling it is redundant.
> 
> Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
> Signed-off-by: Minghao Chi <chi.minghao@xxxxxxxxxx>
> ---
>  drivers/net/wireless/silabs/wfx/fwio.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/silabs/wfx/fwio.c b/drivers/net/wireless/silabs/wfx/fwio.c
> index 3d1b8a135dc0..52c7f560b062 100644
> --- a/drivers/net/wireless/silabs/wfx/fwio.c
> +++ b/drivers/net/wireless/silabs/wfx/fwio.c
> @@ -286,8 +286,7 @@ static int load_firmware_secure(struct wfx_dev *wdev)
> 
>  error:
>         kfree(buf);
> -       if (fw)
> -               release_firmware(fw);
> +       release_firmware(fw);
>         if (ret)
>                 print_boot_status(wdev);
>         return ret;
> --
> 2.25.1

Signed-off-by: Jérôme Pouiller <jerome.pouiller@xxxxxxxxxx>

-- 
Jérôme Pouiller






[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux