Staging: netlogic: fix missing free_netdev() on error in xlr_net_probe()
authorWei Yongjun <weiyj.lk@gmail.com>
Wed, 19 Jun 2013 02:29:59 +0000 (10:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jun 2013 16:41:37 +0000 (09:41 -0700)
Fix missing free_netdev() before return from function xlr_net_probe()
in the devm_ioremap_resource() error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/netlogic/xlr_net.c

index b529d79d0661dc56f92a0de1cdb1b4019acac648..af9e3f1d3a85b8c1c1b2412aa54b3a74f4644e8a 100644 (file)
@@ -1023,9 +1023,8 @@ static int xlr_net_probe(struct platform_device *pdev)
        ndev->base_addr = (unsigned long) devm_ioremap_resource
                (&pdev->dev, res);
        if (IS_ERR_VALUE(ndev->base_addr)) {
-               dev_err(&pdev->dev,
-                               "devm_ioremap_resource failed\n");
-               return ndev->base_addr;
+               err = ndev->base_addr;
+               goto err_gmac;
        }
 
        res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);