Skip to content

Commit

Permalink
staging: wlags49_h2: use free_netdev(netdev) instead of kfree()
Browse files Browse the repository at this point in the history
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: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Vasiliy Kulikov authored and Greg Kroah-Hartman committed Sep 30, 2010
1 parent c95aef4 commit b37e0c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/wlags49_h2/wl_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ void wl_wds_device_dealloc( struct wl_private *lp )
dev_wds->flags &= ~( IFF_UP | IFF_RUNNING );
}

kfree( dev_wds );
free_netdev(dev_wds);
lp->wds_port[count].dev = NULL;
}
}
Expand Down

0 comments on commit b37e0c6

Please sign in to comment.