mwifiex: pcie: Fix memory leak in mwifiex_pcie_init_evt_ring
PATCH 1/1 mwifiex: pcie: Fix memory leak in mwifiex_pcie_init_evt_ring
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.
--- drivers/net/wireless/marvell/mwifiex/pcie.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/marvell/mwifiex/pcie.c +4 -1
@@ -687,8 +687,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);
Signature · 1 line
2.17.1
Hi Navid,
Quoted 2 lines
Fixes 0732484b47b5 ("mwifiex: separate ring initialization and ring creationroutines")
Thanks for the this change as well;
Regards,
Ganapathi
Quoted 3 lines
In
mwifiex_pcie_init_evt_ring, a new skb is allocated which should be released ifmwifiex_map_pci_memory()fails. The release for skb andcard->evtbd_ring_vbaseis added.
Please improve also this change description.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?idNa655343ce4180fe9b2c7ec8cb8ef9884a47901#n151
Regards,
Markus
Quoted 7 lines · Navid Emamdoost
In
mwifiex_pcie_init_evt_ring, a new skb is allocated which should be released ifmwifiex_map_pci_memory()fails. The release for skb andcard->evtbd_ring_vbaseis added.Fixes 0732484b47b5 ("mwifiex: separate ring initialization and ring creation routines")Signed-off-by Navid Emamdoost <[email protected]>Acked-by Ganapathi Bhat <[email protected]>
Patch applied to wireless-drivers-next.git, thanks.
d10dcb615c8e mwifiex: pcie: Fix memory leak in mwifiex_pcie_init_evt_ring
Signature · 3 lines
https://patchwork.kernel.org/patch/11175265/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches