common: mii: Do not allow to exceed max phy limit
PATCH 1/1 common: mii: Do not allow to exceed max phy limit
Phy can have addresses 0-31. Check this boundary to ensure that user can't call commands on phy address 32 and more.
Signed-off-by Michal Simek <[email protected]>
---
common/cmd_mii.c | 5 +++++ 1 file changed, 5 insertions(+)
common/cmd_mii.c +5 -0
@@ -314,6 +314,11 @@ static int do_mii(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) mask =simple_strtoul (argv[5 ],NULL ,16 ); } +if (addrhi >31 ) { +printf ("Incorrect PHY address. Range should be 0-31\n" ); +return CMD_RET_USAGE ; + } +/* use current device */ devname =miiphy_get_current_dev ();
Signature · 1 line
2.5.0
PATCH 1/1 common: mii: Do not allow to exceed max phy limit
Quoted 4 lines · Michal Simek
Phy can have addresses 0-31. Check this boundary to ensure that user can't call commands on phy address 32 and more.
Signed-off-by Michal Simek <[email protected]>
Reviewed-by Tom Rini <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151029/d89f5fb5/attachment.sig>