staging: rtl8187se: r8180_core.c: Inspect the return value of register_netdev()
authorKumar Amit Mehta <gmate.amit@gmail.com>
Wed, 14 Nov 2012 10:00:57 +0000 (15:30 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Nov 2012 00:34:58 +0000 (16:34 -0800)
Inspect the return value of register_netdev() in the driver probe routine and
return -ENODEV in case of error.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8187se/r8180_core.c

index ea04eec3095247ded8ad6597cb08b9ba44e90427..6a27836f989e4d1d8ac25f0f77a6114bd2fbed2a 100644 (file)
@@ -3258,7 +3258,8 @@ static int __devinit rtl8180_pci_probe(struct pci_dev *pdev,
 
        netif_carrier_off(dev);
 
-       register_netdev(dev);
+       if (register_netdev(dev))
+               goto fail1;
 
        rtl8180_proc_init_one(dev);