kconfig: streamline_config.pl: check defined(ENV variable) before using it

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: c027b02d89 ("streamline_config.pl: add LMC_KEEP to preserve some kconfigs")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
Randy Dunlap 2020-08-26 14:21:43 -07:00 коммит произвёл Masahiro Yamada
Родитель 91a9d50219
Коммит a73fbfce2c
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -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]};