Commit 284cf04f authored by Navid Emamdoost's avatar Navid Emamdoost Committed by Kleber Sacilotto de Souza

mwifiex: pcie: Fix memory leak in mwifiex_pcie_init_evt_ring

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

[ Upstream commit d10dcb61 ]

In mwifiex_pcie_init_evt_ring, a new skb is allocated which should be
released if mwifiex_map_pci_memory() fails. The release for skb and
card->evtbd_ring_vbase is added.

Fixes: 0732484b ("mwifiex: separate ring initialization and ring creation routines")
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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent f7bba946
......@@ -588,8 +588,11 @@ static int mwifiex_pcie_init_evt_ring(struct mwifiex_adapter *adapter)
skb_put(skb, MAX_EVENT_SIZE);
if (mwifiex_map_pci_memory(adapter, skb, MAX_EVENT_SIZE,
PCI_DMA_FROMDEVICE))
PCI_DMA_FROMDEVICE)) {
kfree_skb(skb);
kfree(card->evtbd_ring_vbase);
return -1;
}
buf_pa = MWIFIEX_SKB_DMA_ADDR(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