Calling 'mdio read ...' currently leads to a data abort when no mdio
bus is found.
To fix this, check if 'bus' is a valid pointer before accessing it.
Signed-off-by: Simon Goldschmidt <[email protected]>
Tested-by: Vladimir Oltean <[email protected]>
Reviewed-by: Vladimir Oltean <[email protected]>
Acked-by: Joe Hershberger <[email protected]>
break;
}
+ if (!bus) {
+ puts("No MDIO bus found\n");
+ return CMD_RET_FAILURE;
+ }
+
if (op[0] == 'l') {
mdio_list_devices();