Skip to contentSkip to conversation

brcmfmac: Fix memory leak in brcmf_usbdev_qinit

PATCH In review Navid Emamdoost 2 participants 2 messages Dec 15, 2019 – Dec 18, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcmfmac: Fix memory leak in brcmf_usbdev_qinit

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")
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +1 -0
index 06f3c01f10b3..237c6b491b88 100644
@@ -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;
 
 }
Signature · 1 line
2.17.1
#1 lore raw
Quoted 6 lines · Navid Emamdoost

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")

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

4282dc057d75 brcmfmac: Fix memory leak in brcmf_usbdev_qinit

Signature · 3 lines
https://patchwork.kernel.org/patch/11292553/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches