Return-path: Received: from mail-qk0-f195.google.com ([209.85.220.195]:32922 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751916AbdFKNtw (ORCPT ); Sun, 11 Jun 2017 09:49:52 -0400 MIME-Version: 1.0 In-Reply-To: <801f5209-f5a0-7414-f8f4-1500178a680b@broadcom.com> References: <1496442569-11307-1-git-send-email-housel@acm.org> <801f5209-f5a0-7414-f8f4-1500178a680b@broadcom.com> From: Andy Shevchenko Date: Sun, 11 Jun 2017 16:49:50 +0300 Message-ID: (sfid-20170611_155036_822273_9AA899C4) Subject: Re: [PATCH v2] brcmfmac: Fix glom_skb leak in brcmf_sdiod_recv_chain To: Arend van Spriel Cc: "Peter S. Housel" , Franky Lin , Hante Meuleman , Kalle Valo , Pieter-Paul Giesberts , Christian Daudt , Florian Fainelli , Florian Westphal , Martin Blumenstingl , "open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER" , "open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER" , "open list:NETWORKING DRIVERS" , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org List-ID: On Sat, Jun 10, 2017 at 10:27 PM, Arend van Spriel wrote: > On 03-06-17 17:36, Andy Shevchenko wrote: >> On Sat, Jun 3, 2017 at 1:29 AM, Peter S. Housel wrote: The following looks good to me. Feel free to add Reviewed-by: Andy Shevchenko > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c > @@ -705,7 +705,7 @@ int brcmf_sdiod_recv_pkt(struct brcmf_sdio_dev > *sdiodev, struct sk_buff *pkt) > int brcmf_sdiod_recv_chain(struct brcmf_sdio_dev *sdiodev, > struct sk_buff_head *pktq, uint totlen) > { > - struct sk_buff *glom_skb; > + struct sk_buff *glom_skb = NULL; > struct sk_buff *skb; > u32 addr = sdiodev->sbwad; > int err = 0; > @@ -726,10 +726,8 @@ 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); > + if (err) > goto done; > - } > > skb_queue_walk(pktq, skb) { > memcpy(skb->data, glom_skb->data, skb->len); > @@ -740,6 +738,7 @@ int brcmf_sdiod_recv_chain(struct brcmf_sdio_dev > *sdiodev, > pktq); > > done: > + brcmu_pkt_buf_free_skb(glom_skb); > return err; > } > -- With Best Regards, Andy Shevchenko