brcmfmac: Fix memory leak in brcmf_usbdev_qinit
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Sun, 15 Dec 2019 01:51:14 +0000 (19:51 -0600)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 18 Dec 2019 19:08:29 +0000 (21:08 +0200)
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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c

index 7cdfde9..575ed19 100644 (file)
@@ -430,6 +430,7 @@ fail:
                        usb_free_urb(req->urb);
                list_del(q->next);
        }
+       kfree(reqs);
        return NULL;
 
 }