MIPS: FW: Fix parsing u-boot environment
authorAlban Bedel <albeu@free.fr>
Sat, 8 Nov 2014 11:39:38 +0000 (12:39 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 24 Nov 2014 06:45:25 +0000 (07:45 +0100)
When reading u-boot's key=value pairs it should skip the '=' and not
use the next argument.

Signed-off-by: Alban Bedel <albeu@free.fr>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8357/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/fw/lib/cmdline.c

index ffd0345780ae246d66b46f60961154806493a1bd..a0c361e6a5d2d642a20e9d1728dce51b8c0469a4 100644 (file)
@@ -68,7 +68,7 @@ char *fw_getenv(char *envname)
                                        result = fw_envp(index + 1);
                                        break;
                                } else if (fw_envp(index)[i] == '=') {
-                                       result = (fw_envp(index + 1) + i);
+                                       result = fw_envp(index) + i + 1;
                                        break;
                                }
                        }