2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-30 08:04:13 +08:00

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>
This commit is contained in:
Sergei Shtylyov 2013-03-19 13:41:32 +00:00 committed by David S. Miller
parent 0582b7d15f
commit fc0c090040

View File

@ -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;
}