Skip to content

Commit 11904ca

Browse files
NavidemSomasundaram Krishnasamy
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]> (cherry picked from commit 6ddbe82) Orabug: 31246301 CVE: CVE-2019-19056 Signed-off-by: Larry Bassel <[email protected]> Reviewed-by: George Kennedy <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent 4e0ed07 commit 11904ca

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
@@ -1019,8 +1019,10 @@ static int mwifiex_pcie_alloc_cmdrsp_buf(struct mwifiex_adapter *adapter)
10191019
}
10201020
skb_put(skb, MWIFIEX_UPLD_SIZE);
10211021
if (mwifiex_map_pci_memory(adapter, skb, MWIFIEX_UPLD_SIZE,
1022-
PCI_DMA_FROMDEVICE))
1022+
PCI_DMA_FROMDEVICE)) {
1023+
kfree_skb(skb);
10231024
return -1;
1025+
}
10241026

10251027
card->cmdrsp_buf = skb;
10261028

0 commit comments

Comments
 (0)