From patchwork Tue Sep 12 16:01:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Michal_Such=C3=A1nek?= X-Patchwork-Id: 812939 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xs8pK35MBz9s82 for ; Wed, 13 Sep 2017 02:07:53 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xs8pJ02jVzDrps for ; Wed, 13 Sep 2017 02:07:52 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=suse.de (client-ip=195.135.220.15; helo=mx1.suse.de; envelope-from=msuchanek@suse.de; receiver=) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xs8gs684zzDqjt for ; Wed, 13 Sep 2017 02:02:17 +1000 (AEST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id EF860AD6A; Tue, 12 Sep 2017 16:02:14 +0000 (UTC) From: Michal Suchanek To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Jonathan Corbet , Jessica Yu , Rusty Russell , Jason Baron , Mahesh Salgaonkar , Hari Bathini , Michal Suchanek , Daniel Axtens , Nicholas Piggin , Andrew Morton , Michael Neuling , Thiago Jung Bauermann , "Sylvain 'ythier' Hitier" , David Howells , Ingo Molnar , Kees Cook , Thomas Gleixner , "Steven Rostedt, " , Michal Hocko , Laura Abbott , Tejun Heo , Tom Lendacky , Viresh Kumar , Lokesh Vutla , Baoquan He , Ilya Matveychikov , linuxppc-dev@lists.ozlabs.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 4/6] powerpc/fadump: update the dequoting logic to match lib/cmdline.c Date: Tue, 12 Sep 2017 18:01:42 +0200 Message-Id: <490bce7afcb8ae57880cb83d5cf1a07ba1a0fc60.1505231820.git.msuchanek@suse.de> X-Mailer: git-send-email 2.10.2 In-Reply-To: References: In-Reply-To: References: X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Signed-off-by: Michal Suchanek --- 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] == '"')) {