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

LEDE Commits lede-commits at lists.infradead.org
Sun Jul 31 15:13:58 PDT 2016

jogo pushed a commit to source.git, branch master:

commit 532eb5f58109f310d6705d142422d8b2820bf654
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Thu Jul 28 18:08:35 2016 +0200

    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: 0ddcbee26151 ("ipq806x: activate ATAG DTB mangle and EA8500 rootblock in dts")
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
 .../linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch b/target/linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch
index 8d5cbf9..be15ec4 100644
--- a/target/linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch
+++ b/target/linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch
@@ -64,9 +64,9 @@ Signed-off-by: Adrian Panella <ianchi74 at 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;

More information about the lede-commits mailing list