2013-10-30 05:24:40

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH -next] ath10k: fix possible memory leak in ath10k_pci_probe()

From: Wei Yongjun <[email protected]>

memory is malloced in ath10k_pci_probe() and should be freed before
leaving from the error handling cases, otherwise it will cause
memory leak.

Signed-off-by: Wei Yongjun <[email protected]>
---
drivers/net/wireless/ath/ath10k/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index dff23d9..af01631 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2470,7 +2470,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
ret = ath10k_do_pci_wake(ar);
if (ret) {
ath10k_err("Failed to get chip id: %d\n", ret);
- return ret;
+ goto err_iomap;
}

chip_id = ath10k_pci_read32(ar,



2013-11-06 08:50:25

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH -next] ath10k: fix possible memory leak in ath10k_pci_probe()

Wei Yongjun <[email protected]> writes:

> From: Wei Yongjun <[email protected]>
>
> memory is malloced in ath10k_pci_probe() and should be freed before
> leaving from the error handling cases, otherwise it will cause
> memory leak.
>
> Signed-off-by: Wei Yongjun <[email protected]>

Thanks, applied.

--
Kalle Valo