]> Gentwo Git Trees - linux/.git/commitdiff
ktest.pl: Fix uninitialized var in config-bisect.pl
authorSteven Rostedt <rostedt@goodmis.org>
Wed, 3 Dec 2025 23:09:24 +0000 (18:09 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 3 Dec 2025 23:25:18 +0000 (18:25 -0500)
The error path of copying the old config used the wrong variable in the
error message:

 $ mkdir /tmp/build
 $ ./tools/testing/ktest/config-bisect.pl -b /tmp/build config-good /tmp/config-bad
 $ chmod 0 /tmp/build
 $ ./tools/testing/ktest/config-bisect.pl -b /tmp/build config-good /tmp/config-bad good
 cp /tmp/build//.config config-good.tmp ... [0 seconds] FAILED!
 Use of uninitialized value $config in concatenation (.) or string at ./tools/testing/ktest/config-bisect.pl line 744.
 failed to copy  to config-good.tmp

When it should have shown:

 failed to copy /tmp/build//.config to config-good.tmp

Cc: stable@vger.kernel.org
Cc: John 'Warthog9' Hawley <warthog9@kernel.org>
Fixes: 0f0db065999cf ("ktest: Add standalone config-bisect.pl program")
Link: https://patch.msgid.link/20251203180924.6862bd26@gandalf.local.home
Reported-by: "John W. Krahn" <jwkrahn@shaw.ca>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
tools/testing/ktest/config-bisect.pl

index 6fd864935319599bce65fe1770299e9b7eb74c4f..bee7cb34a289c01dbbd92d6316b9e5e84e5c12b6 100755 (executable)
@@ -741,9 +741,9 @@ if ($start) {
        die "Can not find file $bad\n";
     }
     if ($val eq "good") {
-       run_command "cp $output_config $good" or die "failed to copy $config to $good\n";
+       run_command "cp $output_config $good" or die "failed to copy $output_config to $good\n";
     } elsif ($val eq "bad") {
-       run_command "cp $output_config $bad" or die "failed to copy $config to $bad\n";
+       run_command "cp $output_config $bad" or die "failed to copy $output_config to $bad\n";
     }
 }