net: sh_eth: tidyup compile warning
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 23 Jun 2011 16:02:38 +0000 (16:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Jun 2011 04:03:26 +0000 (21:03 -0700)
This patch tidyup below warning

${LINUX}/drivers/net/sh_eth.c:1773: warning:
'mdp' may be used uninitialized in this function

Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/sh_eth.c

index 8a72a979ee711262a613ddbe6e0fd3276b6f77d4..96a629f1678e1512e8d67a86e877e56a8a5eba97 100644 (file)
@@ -1770,7 +1770,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
        int ret, devno = 0;
        struct resource *res;
        struct net_device *ndev = NULL;
-       struct sh_eth_private *mdp;
+       struct sh_eth_private *mdp = NULL;
        struct sh_eth_plat_data *pd;
 
        /* get base addr */
@@ -1888,7 +1888,7 @@ out_unregister:
 
 out_release:
        /* net_dev free */
-       if (mdp->tsu_addr)
+       if (mdp && mdp->tsu_addr)
                iounmap(mdp->tsu_addr);
        if (ndev)
                free_netdev(ndev);