[PATCH] net: sh_eth: tidyup compile warrning

Subsystems: networking drivers, the rest

STALE5524d

2 messages, 2 authors, 2011-06-17 · open the first message on its own page

[PATCH] net: sh_eth: tidyup compile warrning

From: Kuninori Morimoto <hidden>
Date: 2011-06-13 08:17:13

This patch tidyup below warrning

${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 <redacted>
---
 drivers/net/sh_eth.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 8a72a97..96a629f 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -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);
-- 
1.7.4.1

Re: [PATCH] net: sh_eth: tidyup compile warrning

From: David Miller <davem@davemloft.net>
Date: 2011-06-17 03:08:42

From: Kuninori Morimoto <redacted>
Date: Mon, 13 Jun 2011 17:17:09 +0900
This patch tidyup below warrning

${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 <redacted>
Please just move the mdp assignment right after alloc_netdev()
succeeds.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help