mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf
PATCH 1/1 mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf
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.
--- drivers/net/wireless/marvell/mwifiex/pcie.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/marvell/mwifiex/pcie.c +3 -1
@@ -1029,8 +1029,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;
Signature · 1 line
2.17.1
Hi Navid,
Quoted 1 line
Fixes fc3314609047 ("mwifiex: use pci_alloc/free_consistent APIs for PCIe")
Thanks for the change;
Regards,
Ganapathi
Quoted 2 lines
In
mwifiex_pcie_alloc_cmdrsp_buf, a new skb is allocated which should be released ifmwifiex_map_pci_memory()fails. The release is added.
Please improve 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 6 lines · Navid Emamdoost
In
mwifiex_pcie_alloc_cmdrsp_buf, a new skb is allocated which should be released ifmwifiex_map_pci_memory()fails. The release is added.Fixes fc3314609047 ("mwifiex: use pci_alloc/free_consistent APIs for PCIe")Signed-off-by Navid Emamdoost <[email protected]>Acked-by Ganapathi Bhat <[email protected]>
Patch applied to wireless-drivers-next.git, thanks.
db8fd2cde932 mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf
Signature · 3 lines
https://patchwork.kernel.org/patch/11175263/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches