staging: wlags49_h2: fix error return code in wl_adapter_insert()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 17 May 2013 08:43:15 +0000 (16:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2013 22:05:07 +0000 (15:05 -0700)
When return from wl_adapter_insert() in the register_netdev() error
handling case, 'ret' which is 0 is returned, but we should return a
negative error code instead, so fix to return the return value of
register_netdev().

Introduce by commit 657d4c86d4cd85a4696445f6fb2fe0941a5724ff
(staging: wlags49_h2: fix error handling in pcmcia probe function)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlags49_h2/wl_cs.c

index f9e5fd3b02cdcf365a4330f3857a28a4e8139138..b55dc43a1d11ff40b197c7f8f2dc9fa6db4d334a 100644 (file)
@@ -259,7 +259,8 @@ int wl_adapter_insert(struct pcmcia_device *link)
        dev->base_addr  = link->resource[0]->start;
 
        SET_NETDEV_DEV(dev, &link->dev);
-       if (register_netdev(dev) != 0) {
+       ret = register_netdev(dev);
+       if (ret != 0) {
                printk("%s: register_netdev() failed\n", MODULE_NAME);
                goto failed;
        }