Linux-Wireless Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf
@ 2019-10-04 20:08 Navid Emamdoost
  2019-10-05  1:51 ` [EXT] " Ganapathi Bhat
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Navid Emamdoost @ 2019-10-04 20:08 UTC (permalink / raw)
  To: unlisted-recipients:; (no To-header on input)
  Cc: emamd001, kjlu, smccaman, Navid Emamdoost, Amitkumar Karwar,
	Nishant Sarmukadam, Ganapathi Bhat, Xinming Hu, Kalle Valo,
	David S. Miller, linux-wireless, netdev, linux-kernel

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(-)

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;
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [EXT] [PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf
  2019-10-04 20:08 [PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf Navid Emamdoost
@ 2019-10-05  1:51 ` " Ganapathi Bhat
  2019-10-05 16:48 ` Markus Elfring
  2019-10-09  8:25 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Ganapathi Bhat @ 2019-10-05  1:51 UTC (permalink / raw)
  To: Navid Emamdoost
  Cc: emamd001, kjlu, smccaman, Amitkumar Karwar, Nishant Sarmukadam,
	Xinming Hu, Kalle Valo, David S. Miller, linux-wireless, netdev,
	linux-kernel

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf
  2019-10-04 20:08 [PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf Navid Emamdoost
  2019-10-05  1:51 ` [EXT] " Ganapathi Bhat
@ 2019-10-05 16:48 ` Markus Elfring
  2019-10-09  8:25 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2019-10-05 16:48 UTC (permalink / raw)
  To: Navid Emamdoost, linux-wireless, netdev
  Cc: Navid Emamdoost, Kangjie Lu, Stephen McCamant, Amitkumar Karwar,
	David S. Miller, Ganapathi Bhat, Kalle Valo, Nishant Sarmukadam,
	Xinming Hu, linux-kernel, kernel-janitors

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf
  2019-10-04 20:08 [PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf Navid Emamdoost
  2019-10-05  1:51 ` [EXT] " Ganapathi Bhat
  2019-10-05 16:48 ` Markus Elfring
@ 2019-10-09  8:25 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-10-09  8:25 UTC (permalink / raw)
  To: Navid Emamdoost
  Cc: unlisted-recipients:; (no To-header on input) emamd001, kjlu,
	smccaman, Navid Emamdoost, Amitkumar Karwar, Nishant Sarmukadam,
	Ganapathi Bhat, Xinming Hu, David S. Miller, linux-wireless,
	netdev, linux-kernel

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

-- 
https://patchwork.kernel.org/patch/11175263/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-04 20:08 [PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf Navid Emamdoost
2019-10-05  1:51 ` [EXT] " Ganapathi Bhat
2019-10-05 16:48 ` Markus Elfring
2019-10-09  8:25 ` Kalle Valo

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org linux-wireless@archiver.kernel.org
	public-inbox-index linux-wireless

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wireless


AGPL code for this site: git clone https://public-inbox.org/ public-inbox