From: Johannes Berg <johannes@sipsolutions.net>
To: Arend van Spriel <arend.vanspriel@broadcom.com>,
Abdun Nihaal <nihaal@cse.iitm.ac.in>
Cc: linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev,
brcm80211-dev-list.pdl@broadcom.com,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] wifi: brcmfmac: Fix memory leak in brcmf_sdio_read_control()
Date: Mon, 03 Aug 2026 10:57:08 +0200 [thread overview]
Message-ID: <0f7c335c9c1350ed7ef36bc6b633a2b800c44d31.camel@sipsolutions.net> (raw)
In-Reply-To: <c5aad785-8d7d-4015-a3c9-1f70f2a69579@broadcom.com> (sfid-20260803_105505_078678_6131A81D)
On Mon, 2026-08-03 at 10:54 +0200, Arend van Spriel wrote:
> >
> > Or just something like this?
> >
> > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
> > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
> > @@ -1827,15 +1827,17 @@ brcmf_sdio_read_control(struct brcmf_sdio *bus, u8 *hdr, uint len, uint doff)
> > if (bus->rxctl) {
> > brcmf_err("last control frame is being processed.\n");
> > spin_unlock_bh(&bus->rxctl_lock);
> > - vfree(buf);
> > goto done;
> > }
> > bus->rxctl = buf + doff;
> > bus->rxctl_orig = buf;
> > bus->rxlen = len - doff;
> > spin_unlock_bh(&bus->rxctl_lock);
> > + /* buffer is queued */
> > + buf = NULL;
> >
> > done:
> > + vfree(buf);
> > /* Awake any waiters */
> > brcmf_sdio_dcmd_resp_wake(bus);
> > }
> >
> >
> > It's already using vmalloc() so seems it wouldn't care that much about
> > calling vfree(NULL) on the success path?
> True. And yes, the existing vfree() should go, but I figured that goes
> without saying so I did not mention that. I am fine with your proposal,
> but I guess the author will have to submit a v2 patch, right?
I wasn't going to do it myself, but I guess I don't care who does :)
johannes
prev parent reply other threads:[~2026-08-03 8:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 11:07 Abdun Nihaal
2026-08-02 8:38 ` Arend van Spriel
2026-08-02 16:41 ` Johannes Berg
2026-08-02 16:44 ` Johannes Berg
2026-08-03 5:44 ` Arend van Spriel
2026-08-03 8:21 ` Arend van Spriel
2026-08-03 8:35 ` Johannes Berg
2026-08-03 8:54 ` Arend van Spriel
2026-08-03 8:57 ` Johannes Berg [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=0f7c335c9c1350ed7ef36bc6b633a2b800c44d31.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=arend.vanspriel@broadcom.com \
--cc=brcm80211-dev-list.pdl@broadcom.com \
--cc=brcm80211@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nihaal@cse.iitm.ac.in \
--cc=stable@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®