* [PATCH 4/9] s390: use free_netdev(netdev) instead of kfree()
@ 2010-09-26 9:58 Vasiliy Kulikov
2010-09-27 1:56 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Vasiliy Kulikov @ 2010-09-26 9:58 UTC (permalink / raw)
To: kernel-janitors
Cc: Ursula Braun, Frank Blaschka, linux390, Martin Schwidefsky,
Heiko Carstens, David S. Miller, Julia Lawall, linux-s390,
linux-kernel
Freeing netdev without free_netdev() leads to net, tx leaks.
I might lead to dereferencing freed pointer.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
@@
struct net_device* dev;
@@
-kfree(dev)
+free_netdev(dev)
---
drivers/s390/net/ctcm_main.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
index 6edf20b..2c7d2d9 100644
--- a/drivers/s390/net/ctcm_main.c
+++ b/drivers/s390/net/ctcm_main.c
@@ -1154,7 +1154,7 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv)
dev_fsm, dev_fsm_len, GFP_KERNEL);
if (priv->fsm == NULL) {
CTCMY_DBF_DEV(SETUP, dev, "init_fsm error");
- kfree(dev);
+ free_netdev(dev);
return NULL;
}
fsm_newstate(priv->fsm, DEV_STATE_STOPPED);
@@ -1165,7 +1165,7 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv)
grp = ctcmpc_init_mpc_group(priv);
if (grp == NULL) {
MPC_DBF_DEV(SETUP, dev, "init_mpc_group error");
- kfree(dev);
+ free_netdev(dev);
return NULL;
}
tasklet_init(&grp->mpc_tasklet2,
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 4/9] s390: use free_netdev(netdev) instead of kfree()
2010-09-26 9:58 [PATCH 4/9] s390: use free_netdev(netdev) instead of kfree() Vasiliy Kulikov
@ 2010-09-27 1:56 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-09-27 1:56 UTC (permalink / raw)
To: segooon
Cc: kernel-janitors, ursula.braun, blaschka, linux390, schwidefsky,
heiko.carstens, julia, linux-s390, linux-kernel
From: Vasiliy Kulikov <segooon@gmail.com>
Date: Sun, 26 Sep 2010 13:58:09 +0400
> Freeing netdev without free_netdev() leads to net, tx leaks.
> I might lead to dereferencing freed pointer.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> @@
> struct net_device* dev;
> @@
>
> -kfree(dev)
> +free_netdev(dev)
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-27 1:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-26 9:58 [PATCH 4/9] s390: use free_netdev(netdev) instead of kfree() Vasiliy Kulikov
2010-09-27 1:56 ` 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).