Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2bde0e9 authored by Navid Emamdoost's avatar Navid Emamdoost Committed by Greg Kroah-Hartman
Browse files

mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf



commit db8fd2cde93227e566a412cf53173ffa227998bc 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: fc331460 ("mwifiex: use pci_alloc/free_consistent APIs for PCIe")
Signed-off-by: default avatarNavid Emamdoost <navid.emamdoost@gmail.com>
Acked-by: default avatarGanapathi Bhat <gbhat@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0aa8632c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1036,8 +1036,10 @@ static int mwifiex_pcie_alloc_cmdrsp_buf(struct mwifiex_adapter *adapter)
	}
	skb_put(skb, MWIFIEX_UPLD_SIZE);
	if (mwifiex_map_pci_memory(adapter, skb, MWIFIEX_UPLD_SIZE,
				   PCI_DMA_FROMDEVICE))
				   PCI_DMA_FROMDEVICE)) {
		kfree_skb(skb);
		return -1;
	}

	card->cmdrsp_buf = skb;