Skip to content

Commit 6ddbe82

Browse files
Navidemgregkh
authored andcommitted
mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf
commit db8fd2c upstream. 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]> Cc: Ben Hutchings <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c2544fb commit 6ddbe82

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
@@ -1022,8 +1022,10 @@ static int mwifiex_pcie_alloc_cmdrsp_buf(struct mwifiex_adapter *adapter)
10221022
}
10231023
skb_put(skb, MWIFIEX_UPLD_SIZE);
10241024
if (mwifiex_map_pci_memory(adapter, skb, MWIFIEX_UPLD_SIZE,
1025-
PCI_DMA_FROMDEVICE))
1025+
PCI_DMA_FROMDEVICE)) {
1026+
kfree_skb(skb);
10261027
return -1;
1028+
}
10271029

10281030
card->cmdrsp_buf = skb;
10291031

0 commit comments

Comments
 (0)