Skip to content
Snippets Groups Projects
Commit 532eb5f5 authored by Jonas Gorski's avatar Jonas Gorski
Browse files

ipq806x: fix boot hang if cmdline contains words with r in the middle


The ATB DTB mangle code will enter an infinite loop if it encounters a
word in the command line that contains an r in the middle of the word.

Fix this by increasing ptr everytime before invoking strchr, ot avoid
finding the same r again.

This fixes booting at least on Netgear R7500v1, which contains
"ubi.mtd=rootfs" in its commandline, triggering the misbehaviour.

Fixes: 0ddcbee2 ("ipq806x: activate ATAG DTB mangle and EA8500 rootblock in dts")
Signed-off-by: default avatarJonas Gorski <jonas.gorski@gmail.com>
parent ba1aa4e3
No related branches found
No related tags found
No related merge requests found
......@@ -64,9 +64,9 @@ Signed-off-by: Adrian Panella <ianchi74@outlook.com>
+ ptr = str - 1;
+
+ do {
+ ptr++;
+ //first find an 'r' at the begining or after a space
+ do {
+ ptr++;
+ ptr = strchr(ptr, 'r');
+ if(!ptr) return dest;
+
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment