From patchwork Wed Aug 26 21:21:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 11739631 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2BD8F913 for ; Wed, 26 Aug 2020 21:21:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 121CE207BC for ; Wed, 26 Aug 2020 21:21:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="JcmJGGf2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726765AbgHZVVw (ORCPT ); Wed, 26 Aug 2020 17:21:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726753AbgHZVVw (ORCPT ); Wed, 26 Aug 2020 17:21:52 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB8C3C061574; Wed, 26 Aug 2020 14:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:From:Cc:To:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=Xsfx+KabYUh+DH5+P2LawgczRML7gRo0hmmmop5VVHQ=; b=JcmJGGf2yA5/kdHpckUJrt/PTG 1AeBqLH5ZuPIzzV1aSlS+fpiw8WWJwvaOthEnyoxDSElm7nPQwKTnSmk+guFm+BdgXHG2jmgM3evD Dju/YtKirQ0VMCl8l35SNVWt/7qtd34/1EGYbh7eit5LmnRIUEqYXm1UraOVYVuWGn0tsnCsLkXAn ZXneyhuQvgKZrwETjYgKiuDzI37JZuAWjiL3MwlK0loltDVfDKbYbgxX0ZldCW7euUHWETtKmBbG1 MTJNw+2Y29RMafHfIbtLtK36zkJK5euVtlgt9Vo/8IeNl4qxx1mcdwdxJU4Fw/jdZIGHCUFRgU3CI Dxq70WLA==; Received: from [2601:1c0:6280:3f0::19c2] by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kB2rb-00013Y-4X; Wed, 26 Aug 2020 21:21:47 +0000 To: linux-kbuild , LKML , Steven Rostedt , Masahiro Yamada Cc: Changbin Du From: Randy Dunlap Subject: [PATCH] kconfig: streamline_config.pl: check defined(ENV variable) before using it Message-ID: Date: Wed, 26 Aug 2020 14:21:43 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org From: Randy Dunlap A user reported: 'Use of uninitialized value $ENV{"LMC_KEEP"} in split at ./scripts/kconfig/streamline_config.pl line 596.' so first check that $ENV{LMC_KEEP} is defined before trying to use it. Fixes: c027b02d89fd ("streamline_config.pl: add LMC_KEEP to preserve some kconfigs") Signed-off-by: Randy Dunlap Cc: Changbin Du Cc: Steven Rostedt (VMware) Cc: Masahiro Yamada Acked-by: Steven Rostedt (VMware) Reported-by: Nathan Royce --- scripts/kconfig/streamline_config.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- linux-next-20200825.orig/scripts/kconfig/streamline_config.pl +++ linux-next-20200825/scripts/kconfig/streamline_config.pl @@ -593,7 +593,10 @@ while ($repeat) { } my %setconfigs; -my @preserved_kconfigs = split(/:/,$ENV{LMC_KEEP}); +my @preserved_kconfigs; +if (defined($ENV{'LMC_KEEP'})) { + @preserved_kconfigs = split(/:/,$ENV{LMC_KEEP}); +} sub in_preserved_kconfigs { my $kconfig = $config2kfile{$_[0]};