From: "Peter S. Housel" <housel-HInyCGIudOg@public.gmane.org>
To: Arend van Spriel
<arend.vanspriel-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
Franky Lin <franky.lin-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
Hante Meuleman
<hante.meuleman-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Christian Daudt <csd-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
Pieter-Paul Giesberts
<pieter-paul.giesberts-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
Martin Blumenstingl
<martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>,
Florian Fainelli
<f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Peter S. Housel" <housel-HInyCGIudOg@public.gmane.org>,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org (open
list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER),
brcm80211-dev-list.pdl-dY08KVG/lbpWk0Htik3J/w@public.gmane.org
(open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER),
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org (open
list:NETWORKING DRIVERS),
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org (open list)
Subject: [PATCH] brcmfmac: Fix glob_skb leak in brcmf_sdiod_recv_chain
Date: Fri, 2 Jun 2017 10:22:21 -0700 [thread overview]
Message-ID: <1496424146-10928-1-git-send-email-housel@acm.org> (raw)
An earlier change to this function (3bdae810721b) fixed a leak in the
case of an unsuccessful call to brcmf_sdiod_buffrw(). However, the
glob_skb buffer, used for emulating a scattering read, is never used
or referenced after its contents are copied into the destination
buffers, and therefore always needs to be freed by the end of the
function.
Signed-off-by: Peter S. Housel <housel-HInyCGIudOg@public.gmane.org>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
index 9b970dc..4c5064f 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
@@ -727,15 +727,16 @@ int brcmf_sdiod_recv_chain(struct brcmf_sdio_dev *sdiodev,
return -ENOMEM;
err = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_2, false, addr,
glom_skb);
- if (err) {
- brcmu_pkt_buf_free_skb(glom_skb);
- goto done;
- }
+ if (err)
+ goto free_glom_skb;
skb_queue_walk(pktq, skb) {
memcpy(skb->data, glom_skb->data, skb->len);
skb_pull(glom_skb, skb->len);
}
+
+free_glom_skb:
+ brcmu_pkt_buf_free_skb(glom_skb);
} else
err = brcmf_sdiod_sglist_rw(sdiodev, SDIO_FUNC_2, false, addr,
pktq);
--
2.7.4
next reply other threads:[~2017-06-02 17:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-02 17:22 Peter S. Housel [this message]
2017-06-02 18:48 ` [PATCH] brcmfmac: Fix glob_skb leak in brcmf_sdiod_recv_chain Florian Fainelli
2017-06-02 18:52 ` Franky Lin
2017-06-02 22:29 ` [PATCH v2] brcmfmac: Fix glom_skb " Peter S. Housel
2017-06-03 15:36 ` Andy Shevchenko
2017-06-10 19:27 ` Arend van Spriel
[not found] ` <705684CB-D155-45DC-8146-157A536F9FBA@acm.org>
[not found] ` <705684CB-D155-45DC-8146-157A536F9FBA-HInyCGIudOg@public.gmane.org>
2017-06-11 8:08 ` Arend van Spriel
2017-06-11 13:49 ` Andy Shevchenko
2017-06-03 15:46 ` [PATCH] brcmfmac: Fix glob_skb " Andy Shevchenko
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=1496424146-10928-1-git-send-email-housel@acm.org \
--to=housel-hinycgiudog@public.gmane.org \
--cc=arend.vanspriel-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=brcm80211-dev-list.pdl-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=csd-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=franky.lin-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=hante.meuleman-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=pieter-paul.giesberts-dY08KVG/lbpWk0Htik3J/w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).