aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192e
diff options
context:
space:
mode:
authorHimangi Saraogi <himangi774@gmail.com>2014-06-21 15:09:51 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-26 23:59:06 (GMT)
commit49d74d7091364bcfdd3b35b1bda913351d543fed (patch)
tree16a153c864cef1c476865646200321640ff263a0 /drivers/staging/rtl8192e
parenta90c6d530ea15b286feff464dde2e7d409091d8a (diff)
Staging: rtl8192e: adjust error handling
This patch removes a test in error handling code by adding a return path. The Coccinelle semantic match that found the problem is: // <smpl> @@ expression E,E1,E2; @@ E = alloc_etherdev(...) ... when != E = E1 if (...) { ... free_netdev(E); ... return ...; } ... when != E = E2 ( if (...) { ... when != free_netdev(E); return dev; } | * if (...) { ... when != free_netdev(E); return ...; } | register_netdev(E) ) // </smpl> Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192e')
-rw-r--r--drivers/staging/rtl8192e/rtllib_module.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging/rtl8192e/rtllib_module.c
index 136909e..ba95149 100644
--- a/drivers/staging/rtl8192e/rtllib_module.c
+++ b/drivers/staging/rtl8192e/rtllib_module.c
@@ -111,7 +111,7 @@ struct net_device *alloc_rtllib(int sizeof_priv)
dev = alloc_etherdev(sizeof(struct rtllib_device) + sizeof_priv);
if (!dev) {
RTLLIB_ERROR("Unable to network device.\n");
- goto failed;
+ return NULL;
}
ieee = (struct rtllib_device *)netdev_priv_rsl(dev);
memset(ieee, 0, sizeof(struct rtllib_device)+sizeof_priv);
@@ -180,8 +180,7 @@ struct net_device *alloc_rtllib(int sizeof_priv)
return dev;
failed:
- if (dev)
- free_netdev(dev);
+ free_netdev(dev);
return NULL;
}
EXPORT_SYMBOL(alloc_rtllib);

Privacy Policy