mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Joe Perches <joe@perches.com>
Cc: Kalle Valo <kvalo@kernel.org>,
	linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev,
	brcm80211-dev-list.pdl@broadcom.com,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: broadcom: brcmfmac, alloc without null test
Date: Sun, 18 Feb 2024 09:26:27 +0100	[thread overview]
Message-ID: <3e1f11b3-a689-4c8e-bfda-b43649db7106@broadcom.com> (raw)
In-Reply-To: <7658242ceef838cc553cb3bbb63ede20d1bf9cb5.camel@perches.com>

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

On 2/17/2024 8:40 PM, Joe Perches wrote:
> There's a missing NULL alloc test here:
> 
> It doesn't appear obvious what a proper fix is.
> 
> diff -u -p ./drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c /tmp/nothing/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> --- ./drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> +++ /tmp/nothing/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> @@ -4308,7 +4308,6 @@ brcmf_pmksa_v3_op(struct brcmf_if *ifp,
>   	int ret;
>   
>   	pmk_op = kzalloc(sizeof(*pmk_op), GFP_KERNEL);

Thanks, Joe

Looking at the callers I would say returning -ENOMEM here when pmk_op is 
NULL should do the trick.

Regards,
Arend

> -	pmk_op->version = cpu_to_le16(BRCMF_PMKSA_VER_3);
>   
>   	if (!pmksa) {
>   		/* Flush operation, operate on entire list */
> 

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

      reply	other threads:[~2024-02-18  8:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-17 19:40 Joe Perches
2024-02-18  8:26 ` Arend van Spriel [this message]

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=3e1f11b3-a689-4c8e-bfda-b43649db7106@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=brcm80211@lists.linux.dev \
    --cc=joe@perches.com \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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®