[PATCH 3/5] staging/wlags49_h2: correct check of the return value of register_netdev()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
Signed-off-by: Nicolas Pfeiffer <nicolas.pfeiffer@xxxxxx>
---
 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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux