115-v5.6-brcmfmac-Fix-memory-leak-in-brcmf_usbdev_qinit.patch 907 B

1234567891011121314151617181920212223242526
  1. From 4282dc057d750c6a7dd92953564b15c26b54c22c Mon Sep 17 00:00:00 2001
  2. From: Navid Emamdoost <[email protected]>
  3. Date: Sat, 14 Dec 2019 19:51:14 -0600
  4. Subject: [PATCH] brcmfmac: Fix memory leak in brcmf_usbdev_qinit
  5. In the implementation of brcmf_usbdev_qinit() the allocated memory for
  6. reqs is leaking if usb_alloc_urb() fails. Release reqs in the error
  7. handling path.
  8. Fixes: 71bb244ba2fd ("brcm80211: fmac: add USB support for bcm43235/6/8 chipsets")
  9. Signed-off-by: Navid Emamdoost <[email protected]>
  10. Signed-off-by: Kalle Valo <[email protected]>
  11. ---
  12. drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 1 +
  13. 1 file changed, 1 insertion(+)
  14. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
  15. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
  16. @@ -430,6 +430,7 @@ fail:
  17. usb_free_urb(req->urb);
  18. list_del(q->next);
  19. }
  20. + kfree(reqs);
  21. return NULL;
  22. }