提交 bdaeb8f2 编写于 作者: M Michal Simek

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: NMichal Simek <michal.simek@xilinx.com>
Reviewed-by: NTom Rini <trini@konsulko.com>
上级 f3bd7280
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册