From: "Jérôme Pouiller" <jerome.pouiller@silabs.com>
To: cgel.zte@gmail.com
Cc: kvalo@kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Minghao Chi <chi.minghao@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] staging: wfx: Remove redundant NULL check before release_firmware() call
Date: Mon, 06 Jun 2022 08:36:37 +0200 [thread overview]
Message-ID: <5637060.DvuYhMxLoT@pc-42> (raw)
In-Reply-To: <20220606014237.290466-1-chi.minghao@zte.com.cn>
On Monday 6 June 2022 03:42:37 CEST cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
>
> release_firmware() checks for NULL pointers internally so checking
> before calling it is redundant.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
> 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@silabs.com>
--
Jérôme Pouiller
next prev parent reply other threads:[~2022-06-06 6:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-06 1:42 [PATCH] staging: wfx: Remove redundant NULL check before release_firmware() call cgel.zte
2022-06-06 6:36 ` Jérôme Pouiller [this message]
2022-06-08 8:02 ` Kalle Valo
2022-06-10 7:39 ` wifi: " Kalle Valo
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=5637060.DvuYhMxLoT@pc-42 \
--to=jerome.pouiller@silabs.com \
--cc=cgel.zte@gmail.com \
--cc=chi.minghao@zte.com.cn \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=zealci@zte.com.cn \
/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).