aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/of/base.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index adb8764861c0..966d6fdcf427 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -715,13 +715,8 @@ static struct device_node *__of_find_node_by_path(struct device_node *parent,
715{ 715{
716 struct device_node *child; 716 struct device_node *child;
717 int len; 717 int len;
718 const char *end;
719 718
720 end = strchr(path, ':'); 719 len = strcspn(path, "/:");
721 if (!end)
722 end = strchrnul(path, '/');
723
724 len = end - path;
725 if (!len) 720 if (!len)
726 return NULL; 721 return NULL;
727 722