brcmfmac: Fix memory leak in brcmf_usbdev_qinit
diff mbox series

Message ID 20191215015117.21801-1-navid.emamdoost@gmail.com
State Accepted
Commit 4282dc057d750c6a7dd92953564b15c26b54c22c
Delegated to: Kalle Valo
Headers show
Series
  • brcmfmac: Fix memory leak in brcmf_usbdev_qinit
Related show

Commit Message

Navid Emamdoost Dec. 15, 2019, 1:51 a.m. UTC
In the implementation of brcmf_usbdev_qinit() the allocated memory for
reqs is leaking if usb_alloc_urb() fails. Release reqs in the error
handling path.

Fixes: 71bb244ba2fd ("brcm80211: fmac: add USB support for bcm43235/6/8 chipsets")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Kalle Valo Dec. 18, 2019, 7:08 p.m. UTC | #1
Navid Emamdoost <navid.emamdoost@gmail.com> wrote:

> In the implementation of brcmf_usbdev_qinit() the allocated memory for
> reqs is leaking if usb_alloc_urb() fails. Release reqs in the error
> handling path.
> 
> Fixes: 71bb244ba2fd ("brcm80211: fmac: add USB support for bcm43235/6/8 chipsets")
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>

Patch applied to wireless-drivers-next.git, thanks.

4282dc057d75 brcmfmac: Fix memory leak in brcmf_usbdev_qinit

Patch
diff mbox series

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
index 06f3c01f10b3..237c6b491b88 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
@@ -430,6 +430,7 @@  brcmf_usbdev_qinit(struct list_head *q, int qsize)
 			usb_free_urb(req->urb);
 		list_del(q->next);
 	}
+	kfree(reqs);
 	return NULL;
 
 }