staging: wlags49_h2: fix error return code in wl_adapter_insert()

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 657d4c86d4
(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>
This commit is contained in:
Wei Yongjun 2013-05-17 16:43:15 +08:00 committed by Greg Kroah-Hartman
parent 3523a90ed9
commit 49c144c863
1 changed files with 2 additions and 1 deletions

View 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;
}