staging: rtl8192e: rtl8192e: rtl_core.c: Audit the return value of register_netdev()
authorKumar Amit Mehta <gmate.amit@gmail.com>
Thu, 15 Nov 2012 17:22:13 +0000 (22:52 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Nov 2012 23:26:14 +0000 (15:26 -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/rtl8192e/rtl8192e/rtl_core.c

index 81134d312ee3ae6036d9060abd3e648a8f85cca3..f68df241f78e34059dd014162ab110449723a0fa 100644 (file)
@@ -2955,7 +2955,8 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev,
        netif_carrier_off(dev);
        netif_stop_queue(dev);
 
-       register_netdev(dev);
+       if (register_netdev(dev))
+               goto err_free_irq;
        RT_TRACE(COMP_INIT, "dev name: %s\n", dev->name);
 
        rtl8192_proc_init_one(dev);