ANDROID: De-dup fdt_path_offset_namelen check am: 8246453859 am: d230a22138 am: deae0e691d am: 82117c0a8d am: 29d6b4dbf5

Original change: https://android-review.googlesource.com/c/platform/external/dtc/+/2775197

Change-Id: I4d739adf61fb6988f457eaf6cdf948a1efa3cc6a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index a62ec78..362cc4a 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -266,9 +266,6 @@
 	if (namelen < 1)
 		return -FDT_ERR_BADPATH;
 
-	if (namelen < 1)
-		return -FDT_ERR_BADPATH;
-
 	/* see if we have an alias */
 	if (*path != '/') {
 		const char *q = memchr(path, '/', end - p);