Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc0c0900 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller
Browse files

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: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0582b7d1
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;
	}