diff options
Diffstat (limited to 'net/eth.c')
-rw-r--r-- | net/eth.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/eth.c b/net/eth.c index c46a8c30500..26520d30388 100644 --- a/net/eth.c +++ b/net/eth.c @@ -195,10 +195,11 @@ struct udevice *eth_get_dev_by_name(const char *devname) const char *startp = NULL; struct udevice *it; struct uclass *uc; + int len = strlen("eth"); /* Must be longer than 3 to be an alias */ - if (strlen(devname) > strlen("eth")) { - startp = devname + strlen("eth"); + if (!strncmp(devname, "eth", len) && strlen(devname) > len) { + startp = devname + len; seq = simple_strtoul(startp, &endp, 10); } |