net: axienet: move use of resource after validity check
authorRobert Hancock <hancock@sedsystems.ca>
Tue, 11 Jun 2019 16:56:02 +0000 (10:56 -0600)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Jun 2019 05:41:24 +0000 (22:41 -0700)
commit7fa0043d5c74c6ef6ab58ecf7528fd33c6cb07a8
tree68ddce5de89015f7257dac816888257b5b382d12
parentf9a94f85e885c8eced04ef839dfda90f2511b185
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>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c