From: Minghao Chi <[email protected]>
release_firmware() checks for NULL pointers internally so checking
before calling it is redundant.
Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Minghao Chi <[email protected]>
---
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
On Monday 6 June 2022 03:42:37 CEST [email protected] wrote:
> From: Minghao Chi <[email protected]>
>
> release_firmware() checks for NULL pointers internally so checking
> before calling it is redundant.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: Minghao Chi <[email protected]>
> ---
> 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 <[email protected]>
--
J?r?me Pouiller
Jérôme Pouiller <[email protected]> writes:
> On Monday 6 June 2022 03:42:37 CEST [email protected] wrote:
>> From: Minghao Chi <[email protected]>
>>
>> release_firmware() checks for NULL pointers internally so checking
>> before calling it is redundant.
>>
>> Reported-by: Zeal Robot <[email protected]>
>> Signed-off-by: Minghao Chi <[email protected]>
[...]
> Signed-off-by: Jérôme Pouiller <[email protected]>
I'll change this to Acked-by, s-o-b should be used only when you are
part of patch distribution:
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#when-to-use-acked-by-cc-and-co-developed-by
And please edit your quotes, otherwise using patchwork will be painful.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
[email protected] wrote:
> From: Minghao Chi <[email protected]>
>
> release_firmware() checks for NULL pointers internally so checking
> before calling it is redundant.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: Minghao Chi <[email protected]>
> Acked-by: Jérôme Pouiller <[email protected]>
Patch applied to wireless-next.git, thanks.
05a2eebfa650 wifi: wfx: Remove redundant NULL check before release_firmware() call
--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches