Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1489176ybk; Sun, 10 May 2020 18:45:00 -0700 (PDT) X-Google-Smtp-Source: APiQypIYLvmhH3up1DwFscDgRPYrmlERL6OjvqiH4Xt1SesXVuzsMJbvsk43zNkGr0GwsKJxaEBi X-Received: by 2002:a05:6402:3136:: with SMTP id dd22mr11202865edb.165.1589161500607; Sun, 10 May 2020 18:45:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589161500; cv=none; d=google.com; s=arc-20160816; b=yke8QETJjZaLjC/w+TW92dZAp6/ilesDZ+bqinv9oRdVVhdS1n96KGC/Jh4lRc7dnO KIuQami63MVQjBcPL4SEUibJSCL/Pdwaq7bQESxSeik9iqU277dwTABocmUCs2nTO+Oa 9ELncTSxXT0dJb8xjBH9Pciqw0J4gQN4cFNRxSxdYthC4olKAahyBMnfNBXwmh0NWh9a 5r+WiCZYvTQhG5+rH/zlb48JRcHV5mfdH5IX337B/ttLiZI5v1eIacBDebBS56TuQY+r 5U0crTxFMOMbTPaQN/8VFDHi5cYcm4b3JWrFeqDdNqOW5ynrD3mLLK4wpAi2gQUuQKWP efYg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=T4JA7hQQB8ktvfQQlMd6yph3+y3fOxg1TOzsltd2hlY=; b=CDPachgS9dN1OAIZ4GEmanm8P2hWrpGEK1tVb2tGdpqvm3l84guLU6r2JifeQNbHWZ pUiFbBmERew2s8bQGo3Os47lRy7XTXbykCzdMlECY4y2VsyIIWroPL0e/6JXDEm8WbOW NRry/kuatTYts6RG082wQHLJjjVQzMWIazfJWiuOqvK6rrICvB3G2I6jXwJj9bmeLbDG 250M4o1aVaq/zmrHGOUk6gf4exAlsZ3mhUhBuVkn9VAQ3I1Fl+wUoz06GuHed09lx5Rn 8bC4XbbEwOi0Iwl47czXc77GC9O1dZoLoTbqRvktWPyGjt+HTI3A8IgnRTh6zHvAUOlZ eC+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZmV1Z+9J; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r25si4866449edb.189.2020.05.10.18.44.29; Sun, 10 May 2020 18:45:00 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ZmV1Z+9J; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729170AbgEKBja (ORCPT + 99 others); Sun, 10 May 2020 21:39:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:59308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728381AbgEKBja (ORCPT ); Sun, 10 May 2020 21:39:30 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 471B7207FF; Mon, 11 May 2020 01:39:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589161169; bh=am+eWUmxcP2bsJRpLx1IxtNAzjyf4uJ9CE9NU9+VV4g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZmV1Z+9JgrDcuGQn+nqAAmFqyrfQeO6QedzQFdRWaCJKzBK4qEHXvKpwR8JZ840Uy QHuXZ1Hsu2RUFvcRooYjpDKPLaj/wEFL8JH9uiecxsgrijQnxnLKWpeZl19GrJ91dL e8QksDoJXwyTGoSge+Joitn+dCbwjBlLUu/3qKn0= From: Masami Hiramatsu To: Steven Rostedt Cc: Paul Menzel , Borislav Petkov , Kees Cook , Ingo Molnar , Andrew Morton , stable@vger.kernel.org, LKML Subject: [PATCH] bootconfig: Fix to prevent warning message if no bootconfig option Date: Mon, 11 May 2020 10:39:24 +0900 Message-Id: <158916116468.21787.14558782332170588206.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200511095728.8490ad9e3d5a25e7400a4910@kernel.org> References: <20200511095728.8490ad9e3d5a25e7400a4910@kernel.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit de462e5f1071 ("bootconfig: Fix to remove bootconfig data from initrd while boot") causes a cosmetic regression on dmesg, which warns "no bootconfig data" message without bootconfig cmdline option. Fix setup_boot_config() by moving no bootconfig check after commandline option check. Fixes: de462e5f1071 ("bootconfig: Fix to remove bootconfig data from initrd while boot") Reported-by: Paul Menzel Signed-off-by: Masami Hiramatsu --- init/main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/init/main.c b/init/main.c index 1a5da2c2660c..5803ecb411ab 100644 --- a/init/main.c +++ b/init/main.c @@ -400,9 +400,8 @@ static void __init setup_boot_config(const char *cmdline) char *data, *copy; int ret; + /* Cut out the bootconfig data even if we have no bootconfig option */ data = get_boot_config_from_initrd(&size, &csum); - if (!data) - goto not_found; strlcpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE); parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL, @@ -411,6 +410,11 @@ static void __init setup_boot_config(const char *cmdline) if (!bootconfig_found) return; + if (!data) { + pr_err("'bootconfig' found on command line, but no bootconfig found\n"); + return; + } + if (size >= XBC_DATA_MAX) { pr_err("bootconfig size %d greater than max size %d\n", size, XBC_DATA_MAX); @@ -446,8 +450,6 @@ static void __init setup_boot_config(const char *cmdline) extra_init_args = xbc_make_cmdline("init"); } return; -not_found: - pr_err("'bootconfig' found on command line, but no bootconfig found\n"); } #else