Skip to content

Commit d10dcb6

Browse files
NavidemKalle Valo
authored and
Kalle Valo
committed
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: 0732484 ("mwifiex: separate ring initialization and ring creation routines") Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Acked-by: Ganapathi Bhat <gbhat@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
1 parent db8fd2c commit d10dcb6

File tree

1 file changed

+4
-1
lines changed
  • drivers/net/wireless/marvell/mwifiex

1 file changed

+4
-1
lines changed

Diff for: drivers/net/wireless/marvell/mwifiex/pcie.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,11 @@ static int mwifiex_pcie_init_evt_ring(struct mwifiex_adapter *adapter)
687687
skb_put(skb, MAX_EVENT_SIZE);
688688

689689
if (mwifiex_map_pci_memory(adapter, skb, MAX_EVENT_SIZE,
690-
PCI_DMA_FROMDEVICE))
690+
PCI_DMA_FROMDEVICE)) {
691+
kfree_skb(skb);
692+
kfree(card->evtbd_ring_vbase);
691693
return -1;
694+
}
692695

693696
buf_pa = MWIFIEX_SKB_DMA_ADDR(skb);
694697

0 commit comments

Comments
 (0)