Message ID | 20191004200853.23353-1-navid.emamdoost@gmail.com |
---|---|
State | Awaiting Upstream |
Delegated to: | David Miller |
Headers | show |
Series | mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf | expand |
Hi Navid, > Fixes: fc3314609047 ("mwifiex: use pci_alloc/free_consistent APIs for PCIe") Thanks for the change; Acked-by: Ganapathi Bhat <gbhat@marvell.com> Regards, Ganapathi
> 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. Please improve this change description. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=4ea655343ce4180fe9b2c7ec8cb8ef9884a47901#n151 Regards, Markus
Navid Emamdoost <navid.emamdoost@gmail.com> wrote: > 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: fc3314609047 ("mwifiex: use pci_alloc/free_consistent APIs for PCIe") > Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> > Acked-by: Ganapathi Bhat <gbhat@marvell.com> Patch applied to wireless-drivers-next.git, thanks. db8fd2cde932 mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c index eff06d59e9df..1578eaa071bd 100644 --- a/drivers/net/wireless/marvell/mwifiex/pcie.c +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c @@ -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;
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: fc3314609047 ("mwifiex: use pci_alloc/free_consistent APIs for PCIe") Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> --- drivers/net/wireless/marvell/mwifiex/pcie.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)