[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3e1f11b3-a689-4c8e-bfda-b43649db7106@broadcom.com>
Date: Sun, 18 Feb 2024 09:26:27 +0100
From: Arend van Spriel <arend.vanspriel@...adcom.com>
To: Joe Perches <joe@...ches.com>
Cc: Kalle Valo <kvalo@...nel.org>, linux-wireless@...r.kernel.org,
brcm80211@...ts.linux.dev, brcm80211-dev-list.pdl@...adcom.com,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: broadcom: brcmfmac, alloc without null test
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 */
>
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4219 bytes)
Powered by blists - more mailing lists