diff options
author | Robert Hancock <hancock@sedsystems.ca> | 2019-06-11 18:56:02 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-14 07:41:24 +0200 |
commit | 7fa0043d5c74c6ef6ab58ecf7528fd33c6cb07a8 (patch) | |
tree | 68ddce5de89015f7257dac816888257b5b382d12 | |
parent | Merge branch 's390-qeth-next' (diff) | |
download | linux-7fa0043d5c74c6ef6ab58ecf7528fd33c6cb07a8.tar.xz linux-7fa0043d5c74c6ef6ab58ecf7528fd33c6cb07a8.zip |
net: axienet: move use of resource after validity check
We were accessing the pointer returned from platform_get_resource before
checking if it was valid, causing an oops if it was not. Move this access
after the call to devm_ioremap_resource which does the validity check.
Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index da420c881662..561e28a5df04 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1679,13 +1679,13 @@ static int axienet_probe(struct platform_device *pdev) lp->tx_bd_num = TX_BD_NUM_DEFAULT; /* Map device registers */ ethres = platform_get_resource(pdev, IORESOURCE_MEM, 0); - lp->regs_start = ethres->start; lp->regs = devm_ioremap_resource(&pdev->dev, ethres); if (IS_ERR(lp->regs)) { dev_err(&pdev->dev, "could not map Axi Ethernet regs.\n"); ret = PTR_ERR(lp->regs); goto free_netdev; } + lp->regs_start = ethres->start; /* Setup checksum offload, but default to off if not specified */ lp->features = 0; |