Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp77403ybg; Mon, 27 Jul 2020 16:08:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPs1RRoUOh6I+QzZTUa6tfIeEF4zcaEkUJA3m1Mc7p/+CdrjLXcpKPKeW402ujH3bd94Jq X-Received: by 2002:a50:ed15:: with SMTP id j21mr24251680eds.246.1595891322033; Mon, 27 Jul 2020 16:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595891322; cv=none; d=google.com; s=arc-20160816; b=S2uMmTWRG5PW5wtQuWIPb4/Ni4S8fVm979HYBkJSo7suTzMwDyO4IFdQyuVUHXURLq cZn5JQI0B98Y1L6/HLdt2VXKA8Ib9wyYb5XwgB3BMTbhlDyAee7tdx36w35UkcN/Z/Ob jRGmB6IKNppzY6pvpUZWFsAXSVvmvmDjK9spvQVSXbY+Orz6uGZ/QLcLBmtcIHukOkVJ cS9m9Dxqts3Nz+I2vanSaih2XgH8PPnuUEuEDG2fhZxvp9ujRj6GlLK0AXeB7r/QQfix Upm5a1IFeeVLk4Qwo17/EuqDZOtaJX/QvbHCEPm9IcbelGo+cQt+rGdcEDGBHqMbXmxa orAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=y1Rnn4vCkQ65/r9EgXb15c20xR4qwlNC9n/tWJktCdE=; b=DX0RWUWVbOBFw7T15f42pszK8xFmrqG2dBAfJ7U1ip6a4x41ZL6xD4XI1nV5eDauEs h8Hq7DsVXwez59UGbjPdCfQLlDJCLdQGLXoNpNpaJq/ajhowVkqyb2ImLM7p6LY6e2s2 eMGR+QjJfN/BXdT7vejH006sJBt9udeLo7+E+xLMD1utNdSXuRxxhm0gx2BIMputqwaf F1u2RZqhNshEj5f0od+Jx983PkU/psRKyy6AqBDidiR0OH9GzfRXo/ZFerw5VWH3auXO sUN1ErQXJHJUBw2q08mKDasX/w0FTtrZOQ8pp6zpgOCn2cuDkxwIzwbovlNGE17AM8Wz trqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si3816796ejt.242.2020.07.27.16.08.17; Mon, 27 Jul 2020 16:08:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726946AbgG0XIF (ORCPT + 99 others); Mon, 27 Jul 2020 19:08:05 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:39324 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726861AbgG0XIF (ORCPT ); Mon, 27 Jul 2020 19:08:05 -0400 Received: by mail-qt1-f196.google.com with SMTP id w9so13584773qts.6 for ; Mon, 27 Jul 2020 16:08:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y1Rnn4vCkQ65/r9EgXb15c20xR4qwlNC9n/tWJktCdE=; b=pvL7VSHQrNo9T6TiP/O4AGm4GItnnWPXaqA3CnsABYt8+5+khr5IH/UelUWSAkXn0l PmNdsDoS1m+zMh3hFsenYPR2wjsYGnGg671ZqBTRgFAAbbloTCVq5KLZ4cCgoL6pdbHe 9XXN2kYS9OqbVQDNX8HfixyWlRjLI73/Nw4RNJkBoUVSMEUlaOdZnnvQRzmZOIkTvUDF piupzSvyt+NBD7UJbWLgRfnGATNYVbDlEXV4zC+6UT1bM+AQdGyNuEDN05rfuxCAO1VB BR7wrL7pzwZycpzygoX/B2wAcZuhZdsE+Kss42LoJu/g/XhVQO33JgJfiE8VcBUQNEIQ t+DA== X-Gm-Message-State: AOAM530HkjA/x7JDLcMfY+ePK5wqIGZvusIf4WNbqdRkxEH3ax8+m/Ae SiTUVi0p9MYyWzZfZu6CctjMpUJQ X-Received: by 2002:aed:3081:: with SMTP id 1mr24609841qtf.118.1595891284479; Mon, 27 Jul 2020 16:08:04 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id j61sm8216984qtd.52.2020.07.27.16.08.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 16:08:03 -0700 (PDT) From: Arvind Sankar To: Kees Cook , x86@kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v2 2/8] x86/kaslr: Remove bogus warning and unnecessary goto Date: Mon, 27 Jul 2020 19:07:55 -0400 Message-Id: <20200727230801.3468620-3-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200727215047.3341098-1-nivedita@alum.mit.edu> References: <20200727215047.3341098-1-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop the warning on seeing "--" in handle_mem_options. This will trigger whenever one of the memory options is present in the command line together with "--", but there's no problem if that is the case. Replace goto with break. Signed-off-by: Arvind Sankar --- arch/x86/boot/compressed/kaslr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index a4af89646094..21cd9e07f1f6 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -295,10 +295,8 @@ static void handle_mem_options(void) while (*args) { args = next_arg(args, ¶m, &val); /* Stop at -- */ - if (!val && strcmp(param, "--") == 0) { - warn("Only '--' specified in cmdline"); - goto out; - } + if (!val && strcmp(param, "--") == 0) + break; if (!strcmp(param, "memmap")) { mem_avoid_memmap(PARSE_MEMMAP, val); @@ -311,7 +309,7 @@ static void handle_mem_options(void) continue; mem_size = memparse(p, &p); if (mem_size == 0) - goto out; + break; mem_limit = mem_size; } else if (!strcmp(param, "efi_fake_mem")) { @@ -319,7 +317,6 @@ static void handle_mem_options(void) } } -out: free(tmp_cmdline); return; } -- 2.26.2