[PATCH v8 4/6] powerpc/fadump: update the dequoting logic to match lib/cmdline.c

Michal Suchanek msuchanek at suse.de
Wed Sep 13 02:01:42 AEST 2017


Signed-off-by: Michal Suchanek <msuchanek at suse.de>
---
 arch/powerpc/kernel/fadump.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 0e08f1a80af2..b214c1e333dd 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -501,10 +501,12 @@ static void __init fadump_update_params(struct param_info *param_info,
 	}
 
 	/* next_arg removes one leading and one trailing '"' */
-	if (*(tgt + FADUMP_EXTRA_ARGS_LEN + 1) == '"')
-		shortening += 1;
-	if (*(tgt + FADUMP_EXTRA_ARGS_LEN + 1 + vallen + shortening) == '"')
+	if ((*(tgt + FADUMP_EXTRA_ARGS_LEN + 1 + vallen + shortening) == '"') &&
+	    (quoted || (*(tgt + FADUMP_EXTRA_ARGS_LEN + 1) == '"'))) {
 		shortening += 1;
+		if (!quoted)
+			shortening += 1;
+	}
 
 	/* remove one leading and one trailing quote if both are present */
 	if ((val[0] == '"') && (val[vallen - 1] == '"')) {
-- 
2.10.2



More information about the Linuxppc-dev mailing list