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.gab...@fau.de> Signed-off-by: Nicolas Pfeiffer <nicolas.pfeif...@fau.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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/