diff options
| author | Navid Emamdoost <[email protected]> | 2019-10-04 20:16:48 +0000 |
|---|---|---|
| committer | Kalle Valo <[email protected]> | 2019-10-09 08:25:22 +0000 |
| commit | d10dcb615c8e29d403a24d35f8310a7a53e3050c (patch) | |
| tree | 0eb8640db80eb361b2270637b07bf0f25deebb5c | |
| parent | mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf (diff) | |
| download | kernel-d10dcb615c8e29d403a24d35f8310a7a53e3050c.tar.gz kernel-d10dcb615c8e29d403a24d35f8310a7a53e3050c.zip | |
mwifiex: pcie: Fix memory leak in mwifiex_pcie_init_evt_ring
In mwifiex_pcie_init_evt_ring, a new skb is allocated which should be
released if mwifiex_map_pci_memory() fails. The release for skb and
card->evtbd_ring_vbase is added.
Fixes: 0732484b47b5 ("mwifiex: separate ring initialization and ring creation routines")
Signed-off-by: Navid Emamdoost <[email protected]>
Acked-by: Ganapathi Bhat <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
| -rw-r--r-- | drivers/net/wireless/marvell/mwifiex/pcie.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c index 1578eaa071bd..fc1706d0647d 100644 --- a/drivers/net/wireless/marvell/mwifiex/pcie.c +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c @@ -687,8 +687,11 @@ static int mwifiex_pcie_init_evt_ring(struct mwifiex_adapter *adapter) skb_put(skb, MAX_EVENT_SIZE); if (mwifiex_map_pci_memory(adapter, skb, MAX_EVENT_SIZE, - PCI_DMA_FROMDEVICE)) + PCI_DMA_FROMDEVICE)) { + kfree_skb(skb); + kfree(card->evtbd_ring_vbase); return -1; + } buf_pa = MWIFIEX_SKB_DMA_ADDR(skb); |
