]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scripts/decodecode: return 0 on success
authorPatrick Bellasi <derkling@google.com>
Wed, 18 Mar 2026 15:05:45 +0000 (15:05 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 28 Mar 2026 04:19:48 +0000 (21:19 -0700)
The decodecode script always returns an exit code of 1, regardless of
whether the operation was successful or not.  This is because the
"cleanup" function, which is registered to run on any script exit via
"trap cleanup EXIT", contains an unconditional "exit 1".

Remove the "exit 1" from the "cleanup" function so that it only performs
the necessary file cleanup without forcing a non-zero exit status.

Do that to ensure successful script executions now exit with code 0.
Exits due to errors are all handled by the "die()" function and will still
correctly exit with code 1.

Link: https://lkml.kernel.org/r/20260318150545.2809311-1-derkling@google.com
Signed-off-by: Patrick Bellasi <derkling@google.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/decodecode

index 6364218b2178f538b86dab8f37ced5acfada7742..01d25dc110de7ac4b848dabab94dbc205ae941ce 100755 (executable)
@@ -12,7 +12,6 @@ faultlinenum=1
 
 cleanup() {
        rm -f $T $T.s $T.o $T.oo $T.aa $T.dis
-       exit 1
 }
 
 die() {
@@ -49,7 +48,7 @@ done
 
 if [ -z "$code" ]; then
        rm $T
-       exit
+       die "Code line not found"
 fi
 
 echo $code