diff options
author | Vasiliy Kulikov <segooon@gmail.com> | 2010-09-27 03:56:06 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-27 03:56:06 +0200 |
commit | bc68580d41b131396054a1a04a7df4948555ed97 (patch) | |
tree | b2f78691199167967e694dccec273afa29ba0a0c /drivers | |
parent | sgiseeq: use free_netdev(netdev) instead of kfree() (diff) | |
download | linux-bc68580d41b131396054a1a04a7df4948555ed97.tar.xz linux-bc68580d41b131396054a1a04a7df4948555ed97.zip |
s390: use free_netdev(netdev) instead of kfree()
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)
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | 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 6edf20b62de5..2c7d2d9be4d0 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, |