mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Daniil Dulov <d.dulov@aladdin.ru>, Kalle Valo <kvalo@codeaurora.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Pieter-Paul Giesberts <pieterpg@broadcom.com>,
	"Franky (Zhenhui) Lin" <frankyl@broadcom.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	Kan Yan <kanyan@broadcom.com>,
	linux-wireless@vger.kernel.org,
	brcm80211-dev-list.pdl@broadcom.com,
	SHA-cyfmac-dev-list@infineon.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: [PATCH] brcmfmac: Remove unnecessary NULL-check.
Date: Sun, 11 Feb 2024 20:25:21 +0100	[thread overview]
Message-ID: <60a0a753-47ba-4f80-b93e-2878f214bc3c@broadcom.com> (raw)
In-Reply-To: <20240211150516.3475-1-d.dulov@aladdin.ru>

[-- Attachment #1: Type: text/plain, Size: 1307 bytes --]

On 2/11/2024 4:05 PM, Daniil Dulov wrote:
> In this case req will never be NULL, so remove unnecessary check.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.

Looks good to me, but when do we call things a "fix" and when is 
"improvement" more appropriate.

> Fixes: 71bb244ba2fd ("brcm80211: fmac: add USB support for bcm43235/6/8 chipsets")
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
> ---
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
> index 9fb68c2dc7e3..38e4e4f32a39 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
> @@ -455,8 +455,7 @@ brcmf_usbdev_qinit(struct list_head *q, int qsize)
>   	brcmf_err("fail!\n");
>   	while (!list_empty(q)) {
>   		req = list_entry(q->next, struct brcmf_usbreq, list);
> -		if (req)
> -			usb_free_urb(req->urb);
> +		usb_free_urb(req->urb);
>   		list_del(q->next);
>   	}

Ay you are already touching this code you could consider using 
list_for_each_entry_safe().

>   	kfree(reqs);

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4219 bytes --]

  reply	other threads:[~2024-02-11 19:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-11 15:05 Daniil Dulov
2024-02-11 19:25 ` Arend van Spriel [this message]
2024-02-11 19:26   ` Arend van Spriel
2024-02-12  7:52     ` Daniil Dulov
2024-02-12  7:27   ` 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=60a0a753-47ba-4f80-b93e-2878f214bc3c@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=SHA-cyfmac-dev-list@infineon.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=d.dulov@aladdin.ru \
    --cc=davem@davemloft.net \
    --cc=frankyl@broadcom.com \
    --cc=kanyan@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=lvc-project@linuxtesting.org \
    --cc=netdev@vger.kernel.org \
    --cc=pieterpg@broadcom.com \
    /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

all inboxes | Powered by JetHome®