]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/wan/hdlc.c
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
[karo-tx-linux.git] / drivers / net / wan / hdlc.c
index 10cc7df954988efb8c7ed81f7bddaca1c4f0c213..a0a932c63d0a29e367daad9febe6ccf7f6370f3d 100644 (file)
@@ -280,14 +280,13 @@ int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
        if (!try_module_get(proto->module))
                return -ENOSYS;
 
-       if (size)
-               if ((dev_to_hdlc(dev)->state = kmalloc(size,
-                                                      GFP_KERNEL)) == NULL) {
-                       netdev_warn(dev,
-                                   "Memory squeeze on hdlc_proto_attach()\n");
+       if (size) {
+               dev_to_hdlc(dev)->state = kmalloc(size, GFP_KERNEL);
+               if (dev_to_hdlc(dev)->state == NULL) {
                        module_put(proto->module);
                        return -ENOBUFS;
                }
+       }
        dev_to_hdlc(dev)->proto = proto;
        return 0;
 }