cmd: mdio: prevent data abort when no mdio bus is found
PATCH 1/1 cmd: mdio: prevent data abort when no mdio bus is found
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.
---
cmd/mdio.c | 5 +++++ 1 file changed, 5 insertions(+)
cmd/mdio.c +5 -0
@@ -263,6 +263,11 @@ static int do_mdio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])break ; } +if (!bus) { +puts ("No MDIO bus found\n" ); +return CMD_RET_FAILURE ; + } +if (op[0 ] =='l' ) {mdio_list_devices ();
Signature · 1 line
2.20.1
PATCH 1/1 cmd: mdio: prevent data abort when no mdio bus is found
Quoted 8 lines · Simon Goldschmidt
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]>---
Quoted 23 lines
cmd/mdio.c | 5 +++++ 1 file changed, 5 insertions(+)cmd/mdio.c +5
-1@@ -263,6 +263,11 @@ static int do_mdio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])break ; } +if (!bus) { +puts ("No MDIO bus found\n" ); +return CMD_RET_FAILURE ; + } +if (op[0 ] =='l' ) {mdio_list_devices (); --2.20.1
PATCH 1/1 cmd: mdio: prevent data abort when no mdio bus is found
In reply to Simon GoldschmidtQuoted 7 lines · Simon Goldschmidt
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]>
Hi Simon,
https://patchwork.ozlabs.org/patch/1131508/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git
Thanks!
-Joe