Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp668687ybg; Tue, 28 Jul 2020 16:02:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIat2LPP0NGP4W++M78YEaau0tPjloOylgAEey3OqR40aEu0oB7D+d6ynM0lC2o4xgGg9d X-Received: by 2002:a17:906:3685:: with SMTP id a5mr26057331ejc.298.1595977332845; Tue, 28 Jul 2020 16:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595977332; cv=none; d=google.com; s=arc-20160816; b=PlDQMJqrjRqC7LHKs7Nyklp0MKCiTArGdUDCOUSpDwoTNHk/HiIpySyqFWgMR7XtLk OG/nqavAMiyZcaFYLpAxhwBpeZ3UDwMFk0Oybg86cZKfD+7Hk9VR2bkkmpp6G7g7bG6v barP8V00cSukI2rgSCTqZNaiE9mkjXGS4uJqXU/fD2yB8pRMrSzF4oy9c6wR5vWPWu3A /eSiYji46XOv3d7qZ8m6/cn8Ci1MYLCbnNd8oRtkvAgH7IUThG31Ry/OlKQ/TjcGxDWK 63eyJ2xuX6zAXuSo2g7sAu/JsMfDEhtR6y9LVxb1oJR/yVjMAIa2gPcWfs6vbOOePCy2 jW5A== 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=2N/EFsv8ebmKwtE6yt28wdXhzSyxHvM6js1gle2k/jU=; b=rHb7vWDo3dsgr5yuuJtkfUEZvKGMUVi8dDixqGUYhzAd8aCQqyQngH+qdT9V0A7O64 5m6shoInk+AHVGhAg4/zEQEGd3lL4gU1RLavd366cDMgcTZV6aSOhuhIFPiU+CtRL6WF 7RFrccX7B0KRTFP0L7/yMycsknpqx9BO1qdVvDZkG/5N7HMw0vEzuoNjXk9Bz7EsmpXt 8cw/cpI7dMaSPsyT92/OSeaR9jME0Er7D1gDNFEA0+1DZ6tYAuzJjwY46UZqJ1ffzP7U gBhq6b0GmNoPmbGg/R+/sTSTMIGBntfOhqIq69ktiV73X9Pe8BBd/06rp7vLyQHFCffc xaHg== 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 bw25si295ejb.10.2020.07.28.16.01.50; Tue, 28 Jul 2020 16:02:12 -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 S1730357AbgG1W6e (ORCPT + 99 others); Tue, 28 Jul 2020 18:58:34 -0400 Received: from mail-qv1-f65.google.com ([209.85.219.65]:41566 "EHLO mail-qv1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729895AbgG1W50 (ORCPT ); Tue, 28 Jul 2020 18:57:26 -0400 Received: by mail-qv1-f65.google.com with SMTP id x6so4149810qvr.8 for ; Tue, 28 Jul 2020 15:57:25 -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=2N/EFsv8ebmKwtE6yt28wdXhzSyxHvM6js1gle2k/jU=; b=i5WzmtjH67YP4peV4XLgtb+ynNpAfdEELOcRPKb+RQe8emRSpo+aJYXgWg7kj4D1iU S4Dw7F7AO89BjUMXCfhTOtLo0MJKXnEBSq9+rEMAPQ1jEaX/9t/MRMoS/6U+FkhGy0Jt vR82AmEY2vUV7BNxYkGTxMFewcMM7yZVVjuKN1QomZKFI7Ft+kIG4trWY4QGSgWUt13h OxCDYGNFx1Pf+/5X2744ReSlKq2dQdY6cdZblUHinfr7sF9jK99Xja38Gahd3feTOfhS C6yEg8iU2SYGaByYoTtFsIGmZqDA+xCPrDbHuoPaAnzTu1/hi9f0Q5frCNkT7bdJ7h5H WG9Q== X-Gm-Message-State: AOAM531UEhzHTBW9LcLG7V5En2P9Kcxp4tpsRvw7eS2dy/VuQbttYLZg PblCpZzEJUSLggLYqX56ZZ8= X-Received: by 2002:ad4:452c:: with SMTP id l12mr29492667qvu.198.1595977045298; Tue, 28 Jul 2020 15:57:25 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id o187sm88118qkd.112.2020.07.28.15.57.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 15:57:24 -0700 (PDT) From: Arvind Sankar To: Kees Cook , x86@kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v3 02/21] x86/kaslr: Remove bogus warning and unnecessary goto Date: Tue, 28 Jul 2020 18:57:03 -0400 Message-Id: <20200728225722.67457-3-nivedita@alum.mit.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200727230801.3468620-1-nivedita@alum.mit.edu> References: <20200727230801.3468620-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 e0f69f3625ae..c31f3a5ab9e4 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