linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: brcm80211-dev-list.pdl@broadcom.com
Cc: linux-wireless@vger.kernel.org, pieterpg@broadcom.com,
	kvalo@codeaurora.org, arend.vanspriel@broadcom.com,
	hante.meuleman@broadcom.com,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH 1/4] brcmfmac: Fix glob_skb leak in brcmf_sdiod_recv_chain
Date: Mon, 18 Jul 2016 16:24:34 -0700	[thread overview]
Message-ID: <1468884277-18606-2-git-send-email-f.fainelli@gmail.com> (raw)
In-Reply-To: <1468884277-18606-1-git-send-email-f.fainelli@gmail.com>

In case brcmf_sdiod_recv_chain() cannot complete a succeful call to
brcmf_sdiod_buffrw, we would be leaking glom_skb and not free it as we
should, fix this.

Reported-by: coverity (CID 1164856)
Fixes: a413e39a38573 ("brcmfmac: fix brcmf_sdcard_recv_chain() for host without sg support")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
index c4b89d27e2e8..f549c25608d6 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
@@ -726,8 +726,10 @@ 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)
+		if (err) {
+			brcmu_pkt_buf_free_skb(glom_skb);
 			goto done;
+		}
 
 		skb_queue_walk(pktq, skb) {
 			memcpy(skb->data, glom_skb->data, skb->len);
-- 
2.7.4


  reply	other threads:[~2016-07-18 23:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18 23:24 [PATCH 0/4] brcm80211: Misc coverity fixes Florian Fainelli
2016-07-18 23:24 ` Florian Fainelli [this message]
2016-07-19 10:19   ` [PATCH 1/4] brcmfmac: Fix glob_skb leak in brcmf_sdiod_recv_chain Arend Van Spriel
2016-07-19 18:14   ` [1/4] " Kalle Valo
2016-07-18 23:24 ` [PATCH 2/4] brcmsmac: Free packet if dma_mapping_error() fails in dma_rxfill Florian Fainelli
2016-07-19  9:25   ` Arend Van Spriel
2016-07-18 23:24 ` [PATCH 3/4] brcmsmac: Fix invalid memcpy() size in brcms_c_d11hdrs_mac80211 Florian Fainelli
2016-07-19 10:38   ` Arend Van Spriel
2016-07-19 12:40     ` Kalle Valo
2016-07-19 16:42     ` Florian Fainelli
2016-07-19 18:26       ` Arend Van Spriel
2016-07-18 23:24 ` [PATCH 4/4] brcmsmac: Initialize power in brcms_c_stf_ss_algo_channel_get() Florian Fainelli
2016-07-19 10:26   ` Arend Van Spriel
2016-07-19  9:20 ` [PATCH 0/4] brcm80211: Misc coverity fixes Arend Van Spriel
2016-07-19 16:41   ` Florian Fainelli
2016-07-19 18:21     ` Arend Van Spriel
2016-07-19 18:30       ` Florian Fainelli
2016-07-19 19:36         ` Arend Van Spriel
2016-07-19 20:09           ` Florian Fainelli

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=1468884277-18606-2-git-send-email-f.fainelli@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=hante.meuleman@broadcom.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@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;
as well as URLs for NNTP newsgroup(s).