From: Kumar Amit Mehta Date: Thu, 15 Nov 2012 17:22:13 +0000 (+0530) Subject: staging: rtl8192e: rtl8192e: rtl_core.c: Audit the return value of register_netdev() X-Git-Tag: v3.8-rc1~178^2~308 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4087641b255cb003ce653aac79e3445fcb864552;p=platform%2Fupstream%2Fkernel-adaptation-pc.git staging: rtl8192e: rtl8192e: rtl_core.c: Audit the return value of register_netdev() 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 81134d3..f68df24 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -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);