Skip to content

Commit 6ed79ce

Browse files
Tang Bindavem330
authored andcommitted
net: ethernet: ixp4xx: Add error handling in ixp4xx_eth_probe()
The function ixp4xx_eth_probe() does not perform sufficient error checking after executing devm_ioremap_resource(), which can result in crashes if a critical error path is encountered. Fixes: f458ac4 ("ARM/net: ixp4xx: Pass ethernet physical base as resource") Signed-off-by: Zhang Shengju <[email protected]> Signed-off-by: Tang Bin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ce22274 commit 6ed79ce

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/xscale/ixp4xx_eth.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,8 @@ static int ixp4xx_eth_probe(struct platform_device *pdev)
13871387
return -ENODEV;
13881388
regs_phys = res->start;
13891389
port->regs = devm_ioremap_resource(dev, res);
1390+
if (IS_ERR(port->regs))
1391+
return PTR_ERR(port->regs);
13901392

13911393
switch (port->id) {
13921394
case IXP4XX_ETH_NPEA:

0 commit comments

Comments
 (0)