brcmfmac: Fix memory leak for unpaired brcmf_{alloc/free}
There are missig brcmf_free() for brcmf_alloc(). Fix memory leak
by adding missed brcmf_free().
Reported-by: Jaehoon Chung <jh80.chung@samsung.com>
Fixes: a1f5aac176
("brcmfmac: don't realloc wiphy during PCIe reset")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1603849967-22817-1-git-send-email-sw0312.kim@samsung.com
This commit is contained in:
parent
398d816a64
commit
9db946284e
|
@ -1937,16 +1937,18 @@ brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||
fwreq = brcmf_pcie_prepare_fw_request(devinfo);
|
||||
if (!fwreq) {
|
||||
ret = -ENOMEM;
|
||||
goto fail_bus;
|
||||
goto fail_brcmf;
|
||||
}
|
||||
|
||||
ret = brcmf_fw_get_firmwares(bus->dev, fwreq, brcmf_pcie_setup);
|
||||
if (ret < 0) {
|
||||
kfree(fwreq);
|
||||
goto fail_bus;
|
||||
goto fail_brcmf;
|
||||
}
|
||||
return 0;
|
||||
|
||||
fail_brcmf:
|
||||
brcmf_free(&devinfo->pdev->dev);
|
||||
fail_bus:
|
||||
kfree(bus->msgbuf);
|
||||
kfree(bus);
|
||||
|
|
|
@ -4541,6 +4541,7 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus)
|
|||
brcmf_sdiod_intr_unregister(bus->sdiodev);
|
||||
|
||||
brcmf_detach(bus->sdiodev->dev);
|
||||
brcmf_free(bus->sdiodev->dev);
|
||||
|
||||
cancel_work_sync(&bus->datawork);
|
||||
if (bus->brcmf_wq)
|
||||
|
|
Loading…
Reference in New Issue