Skip to content

Commit

Permalink
sh_eth: check TSU registers ioremap() error
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Sergei Shtylyov authored and davem330 committed Mar 20, 2013
1 parent 0582b7d commit fc0c090
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/renesas/sh_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fc0c090

Please sign in to comment.