Skip to content

Commit db8fd2c

Browse files
NavidemKalle Valo
authored andcommitted
mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf
In mwifiex_pcie_alloc_cmdrsp_buf, a new skb is allocated which should be released if mwifiex_map_pci_memory() fails. The release is added. Fixes: fc33146 ("mwifiex: use pci_alloc/free_consistent APIs for PCIe") Signed-off-by: Navid Emamdoost <[email protected]> Acked-by: Ganapathi Bhat <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 39e50f5 commit db8fd2c

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

drivers/net/wireless/marvell/mwifiex/pcie.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,10 @@ static int mwifiex_pcie_alloc_cmdrsp_buf(struct mwifiex_adapter *adapter)
10291029
}
10301030
skb_put(skb, MWIFIEX_UPLD_SIZE);
10311031
if (mwifiex_map_pci_memory(adapter, skb, MWIFIEX_UPLD_SIZE,
1032-
PCI_DMA_FROMDEVICE))
1032+
PCI_DMA_FROMDEVICE)) {
1033+
kfree_skb(skb);
10331034
return -1;
1035+
}
10341036

10351037
card->cmdrsp_buf = skb;
10361038

0 commit comments

Comments
 (0)