summaryrefslogtreecommitdiff
path: root/drivers/net/wan/hdlc.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-02-03 21:28:12 +0400
committerDavid S. Miller <davem@davemloft.net>2013-02-04 22:22:34 +0400
commit1d5d1fdc52b879d8d2bb40546472b4dcfd99f118 (patch)
tree1a473daf8616769c3aaa8272d2c64bfca0a43963 /drivers/net/wan/hdlc.c
parent38673c8218a6bcaac97b0243089e33617e28f43f (diff)
downloadlinux-1d5d1fdc52b879d8d2bb40546472b4dcfd99f118.tar.xz
wan: Remove unnecessary alloc/OOM messages
alloc failures already get standardized OOM messages and a dump_stack. Hoist assigns from if tests. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan/hdlc.c')
-rw-r--r--drivers/net/wan/hdlc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c
index 10cc7df95498..a0a932c63d0a 100644
--- a/drivers/net/wan/hdlc.c
+++ b/drivers/net/wan/hdlc.c
@@ -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;
}