netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] net: netcp: drop kfree for memory allocated with devm_kzalloc
@ 2016-10-22 12:32 Wei Yongjun
  2016-10-26 21:25 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2016-10-22 12:32 UTC (permalink / raw)
  To: Wingman Kwok, Murali Karicheri; +Cc: Wei Yongjun, netdev

From: Wei Yongjun <weiyongjun1@huawei.com>

It's not necessary to free memory allocated with devm_kzalloc in the
remove path and using kfree leads to a double free.

Fixes: 84640e27f230 ("net: netcp: Add Keystone NetCP core ethernet
driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/ethernet/ti/netcp_core.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
index 11609d5..2fb5b6d 100644
--- a/drivers/net/ethernet/ti/netcp_core.c
+++ b/drivers/net/ethernet/ti/netcp_core.c
@@ -2058,7 +2058,6 @@ static void netcp_delete_interface(struct netcp_device *netcp_device,
 		if (module->release)
 			module->release(intf_modpriv->module_priv);
 		list_del(&intf_modpriv->intf_list);
-		kfree(intf_modpriv);
 	}
 	WARN(!list_empty(&netcp->module_head), "%s interface module list is not empty!\n",
 	     ndev->name);
@@ -2153,7 +2152,6 @@ static int netcp_remove(struct platform_device *pdev)
 		dev_dbg(&pdev->dev, "Removing module \"%s\"\n", module->name);
 		module->remove(netcp_device, inst_modpriv->module_priv);
 		list_del(&inst_modpriv->inst_list);
-		kfree(inst_modpriv);
 	}
 
 	/* now that all modules are removed, clean up the interfaces */

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

* Re: [PATCH -next] net: netcp: drop kfree for memory allocated with devm_kzalloc
  2016-10-22 12:32 [PATCH -next] net: netcp: drop kfree for memory allocated with devm_kzalloc Wei Yongjun
@ 2016-10-26 21:25 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-10-26 21:25 UTC (permalink / raw)
  To: weiyj.lk; +Cc: w-kwok2, m-karicheri2, weiyongjun1, netdev


None of your patches apply to the net-next tree.

I'm getting extremely troubled by the quality of your submissions and
the effort you are not putting into making sure you submit patches
which will apply cleanly against the net-next tree.

I think I'm at the point where it is extremely fair for me to warn you
that if this continues any further I reserve the right to start
ignoring your submissions completely because they are having a
negative effect on my ability to process the pending patch queue for
networking.

You have been warned, and so please do not make any excuses or be
surprised in the future if less attention is paid to your submissions.

Thank you.

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

end of thread, other threads:[~2016-10-26 21:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-22 12:32 [PATCH -next] net: netcp: drop kfree for memory allocated with devm_kzalloc Wei Yongjun
2016-10-26 21:25 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).