Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2712971ybk; Tue, 12 May 2020 06:25:41 -0700 (PDT) X-Google-Smtp-Source: APiQypJpL7d70p5+ixG6HxzfzzfNHbvk/YAr/9cW3LXSRGdQpCwe+vN2N4OLsAHMISzpEbEYrOtl X-Received: by 2002:a17:907:364:: with SMTP id rs4mr13536688ejb.311.1589289940785; Tue, 12 May 2020 06:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589289940; cv=none; d=google.com; s=arc-20160816; b=j1tjjTz3/B3qhdJdCVsEA1YMTvCB8VrOreOTAuxQsOcWhu6mhEHoL1T82NLiPyQXuw gYOVdvB2HLWGpCsxfcdGbcwZdx2q9k6U/CxK/zCstMepOCN2RNJzJlz9eI1fCCSTLCyk ldxlwdc9Prq/Ox9JzT6Gs+t0Ru/xsWsqyYQy1uhnompxFLU+qv7My0KK34G/4W1oiE/P frumwtfgNOBstF30JJWBa2YGqgnkIIWA18hSu4huU61TA0bUKIqBUt6SxxPVgkSsG0rP +ALFKU7f3mUoXTJM+FsRZsq+m/s0MscF82LsC8UNVZ3aTSDM2s89+rl1iWvBwT92sUTG pY3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:subject:cc:to :from:date:user-agent:message-id; bh=EWPPDyY+3CMqXgya+YnlUSFF9rOdsT6plqxp0iTRl5c=; b=1K1STnkimTCia0Y1ukxyzwC8TJTWaBNVx7OY0eExaaAX6oiuFhqjnQHG5EvvCIu7zU ujp5dJ5FNBHv2j2FWUBiNxhvNOZyoEoofseEqWhfWUNmdfTjwkwu+n450dkP7Oc8W2Wl OILYd12cMBrr39Y5liXalIZ/y02ZvWDv7GPXWH7iP7osBtn7oY0anh88TFt/Lvra+scN hE59Op2MOWWbumS0c+8cErDhsbUO+OZYU0fCdcnG8+ewiolG6bSqhvijH9bTTSSYJabZ LZo5EvYcO4+opgiA4jwze7yNDHe+Z8jvlMVi1qIf7eWtQr2oFe1pOyk4X67rcc+7HXas UkIQ== 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 z8si6558371edl.471.2020.05.12.06.25.14; Tue, 12 May 2020 06:25:40 -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 S1730013AbgELNXu (ORCPT + 99 others); Tue, 12 May 2020 09:23:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:57516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729866AbgELNXt (ORCPT ); Tue, 12 May 2020 09:23:49 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 37EBF207DD; Tue, 12 May 2020 13:23:49 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.93) (envelope-from ) id 1jYUsu-0006PA-4k; Tue, 12 May 2020 09:23:48 -0400 Message-ID: <20200512132348.029291894@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 12 May 2020 09:23:20 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Paul Menzel , Masami Hiramatsu Subject: [for-linus][PATCH 3/3] bootconfig: Fix to prevent warning message if no bootconfig option References: <20200512132317.343672858@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masami Hiramatsu 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. Link: http://lkml.kernel.org/r/9b1ba335-071d-c983-89a4-2677b522dcc8@molgen.mpg.de Link: http://lkml.kernel.org/r/158916116468.21787.14558782332170588206.stgit@devnote2 Fixes: de462e5f1071 ("bootconfig: Fix to remove bootconfig data from initrd while boot") Reported-by: Paul Menzel Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) --- 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 -- 2.26.2