diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2013-03-19 13:41:32 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-20 12:17:59 -0400 |
commit | fc0c0900408e05758a0df17c1924ca837fafca5e (patch) | |
tree | e6c2b366491a8c4db3f653597a50f70343a49c94 | |
parent | 0582b7d15f8a7ae53dd2128b8eb01567b3fd2277 (diff) |
sh_eth: check TSU registers ioremap() error
One must check the result of ioremap() -- in this case it prevents potential
kernel oops when initializing TSU registers further on...
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index c87862812ea..bf5e3cf97c4 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -2446,6 +2446,11 @@ static int sh_eth_drv_probe(struct platform_device *pdev) } mdp->tsu_addr = ioremap(rtsu->start, resource_size(rtsu)); + if (mdp->tsu_addr == NULL) { + ret = -ENOMEM; + dev_err(&pdev->dev, "TSU ioremap failed.\n"); + goto out_release; + } mdp->port = devno % 2; ndev->features = NETIF_F_HW_VLAN_FILTER; } |