summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/eth.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/eth.c b/net/eth.c
index c46a8c3..26520d3 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);
}