Skip to contentSkip to conversation

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

PATCH In review Randy Dunlap 3 participants 6 messages Aug 26, 2020 – Sep 3, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

From: Randy Dunlap <[email protected]>

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")
Cc Changbin Du <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Masahiro Yamada <[email protected]>
---
 scripts/kconfig/streamline_config.pl |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
scripts/kconfig/streamline_config.pl +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]};
#1 lore raw
Quoted 10 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

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.

Quoted 7 lines
Fixes c027b02d89fd ("streamline_config.pl: add LMC_KEEP to preserve some kconfigs")
Cc Changbin Du <[email protected]>
Cc Steven Rostedt (VMware) <[email protected]>
Cc Masahiro Yamada <[email protected]>

---

Applied to linux-kbuild/fixes with Nathan's tag

Nathan,
I think adding your tag is OK to credit your contribution. Please let me know if you do not have it in
the commit log.

Quoted 18 lines
 scripts/kconfig/streamline_config.pl |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
scripts/kconfig/streamline_config.pl +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]};
Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw

Thanks, but I'd just as soon not be acknowledged/credited. All I did was submit a report.

Quoted 17 lines · Masahiro Yamada

Applied to linux-kbuild/fixes with Nathan's tag

Nathan,
I think adding your tag is OK to credit your contribution. Please let me know if you do not have it in
the commit log.

--
Best Regards
Masahiro Yamada

#3 lore raw
Quoted 16 lines · Nathan Royce

Thanks, but I'd just as soon not be acknowledged/credited. All I did was submit a report.

Quoted 11 lines · Masahiro Yamada

Applied to linux-kbuild/fixes with Nathan's tag

Nathan,
I think adding your tag is OK to credit your contribution. Please let me know if you do not have it in
the commit log.

Even if you do not write the code, reporting bugs is a great contribution, and the Reported-by exists for that, I think.

So, I just want to add your Reported-by tag (if you do not mind).

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw

Heard, but all the same if it isn't important (which I'm assuming), I'd just as soon be left out of it. That's just the way I am in general, not wanting to be seen unless I have to be seen. Thanks though.

Quoted 12 lines · Masahiro Yamada

Even if you do not write the code, reporting bugs is a great contribution, and the Reported-by exists for that, I think.

So, I just want to add your Reported-by tag (if you do not mind).

--
Best Regards
Masahiro Yamada

#5 lore raw
Quoted 5 lines · Nathan Royce

Heard, but all the same if it isn't important (which I'm assuming), I'd just as soon be left out of it. That's just the way I am in general, not wanting to be seen unless I have to be seen. Thanks though.

OK, I will drop your tag.

Signature · 2 lines
Best Regards
Masahiro Yamada