[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1402930253-32537-4-git-send-email-stephan.gabert@fau.de>
Date: Mon, 16 Jun 2014 16:50:51 +0200
From: Stephan Gabert <stephan.gabert@....de>
To: pe1dnn@...at.org, gregkh@...uxfoundation.org
Cc: nicolas.pfeiffer@....de, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org, linux-kernel@...cs.fau.de,
Stephan Gabert <stephan.gabert@....de>
Subject: [PATCH 3/5] staging/wlags49_h2: correct check of the return value of register_netdev()
As mentioned in net/core/dev.c register_netdev() explicitly returns a
negative errno code on failure.
So in case of failure, one should rather test whether ret is negative
than just unlike 0.
Signed-off-by: Stephan Gabert <stephan.gabert@....de>
Signed-off-by: Nicolas Pfeiffer <nicolas.pfeiffer@....de>
---
drivers/staging/wlags49_h2/wl_cs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wlags49_h2/wl_cs.c b/drivers/staging/wlags49_h2/wl_cs.c
index c79f1ed..764f547 100644
--- a/drivers/staging/wlags49_h2/wl_cs.c
+++ b/drivers/staging/wlags49_h2/wl_cs.c
@@ -232,7 +232,7 @@ int wl_adapter_insert(struct pcmcia_device *link)
SET_NETDEV_DEV(dev, &link->dev);
ret = register_netdev(dev);
- if (ret != 0) {
+ if (ret < 0) {
printk("%s: register_netdev() failed\n", KBUILD_MODNAME);
goto failed;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists