Skip to content

Commit

Permalink
staging: otus: 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 b37e0c6 commit 2166abe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/otus/usbdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ void usbdrv_clear_structs(struct net_device *dev)

kfree(macp);

kfree(dev);
free_netdev(dev);

}

Expand Down

0 comments on commit 2166abe

Please sign in to comment.