Merge branch 'topic/misc' into for-linus
[safe/jmp/linux-2.6] / net / x25 / x25_route.c
index 2c999cc..97d77c5 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <linux/if_arp.h>
 #include <linux/init.h>
+#include <linux/slab.h>
 #include <net/x25.h>
 
 LIST_HEAD(x25_route_list);
@@ -136,8 +137,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;
 }
@@ -190,7 +193,7 @@ int x25_route_ioctl(unsigned int cmd, void __user *arg)
                goto out;
 
        rc = -EINVAL;
-       if (rt.sigdigits < 0 || rt.sigdigits > 15)
+       if (rt.sigdigits > 15)
                goto out;
 
        dev = x25_dev_get(rt.device);