Skip to contentSkip to conversation

common: mii: Do not allow to exceed max phy limit

PATCH New Michal Simek 2 participants 2 messages Oct 27, 2015 – Oct 30, 2015

lore
Share & tools
lore
#0 lore raw

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.

---

 common/cmd_mii.c | 5 +++++
 1 file changed, 5 insertions(+)
common/cmd_mii.c +5 -0
index 5e9079da0487..7ef7532a502a 100644
@@ -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
#1 lore raw

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.

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>