Skip to content

Commit

Permalink
X25: Fix oops and refcnt problems from x25_dev_get
Browse files Browse the repository at this point in the history
Calls to x25_dev_get check for dev = NULL which was not set.
It allowed x25 to set routes and ioctls on down interfaces.
This caused oopses and refcnt problems on device_unregister.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
andrew hendry authored and David S. Miller committed Nov 29, 2009
1 parent 1fd975a commit 429d33a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/x25/x25_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ struct net_device *x25_dev_get(char *devname)
#if defined(CONFIG_LLC) || defined(CONFIG_LLC_MODULE)
&& dev->type != ARPHRD_ETHER
#endif
)))
))){
dev_put(dev);
dev = NULL;
}

return dev;
}
Expand Down

0 comments on commit 429d33a

Please sign in to comment.