Commit 1fd1cb18 authored by Navid Emamdoost's avatar Navid Emamdoost Committed by Khalid Elmously

mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf

BugLink: https://bugs.launchpad.net/bugs/1859865

commit db8fd2cd 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>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 49849c75
......@@ -932,8 +932,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment