Skip to content

Commit

Permalink
sgiseeq: 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: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kulikov Vasiliy authored and David S. Miller committed Sep 27, 2010
1 parent 22138d3 commit 8d879de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/sgiseeq.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ static int __devinit sgiseeq_probe(struct platform_device *pdev)
err_out_free_page:
free_page((unsigned long) sp->srings);
err_out_free_dev:
kfree(dev);
free_netdev(dev);

err_out:
return err;
Expand Down

0 comments on commit 8d879de

Please sign in to comment.