aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Efremov <efremov@linux.com>2018-08-10 16:25:55 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-08-13 19:58:56 -0400
commit512ddf7d7db056edfed3159ea7cb4e4a5eefddd4 (patch)
treed4ab5068f95916e5493aaaaf546219a9001fe64a
parent09d4d9648bd01a4c124fcc30dd0c31503975e8c2 (diff)
coccicheck: return proper error code on fail
If coccicheck fails, it should return an error code distinct from zero to signal about an internal problem. Current code instead of exiting with the tool's error code returns the error code of 'echo "coccicheck failed"' which is almost always equals to zero, thus failing the original intention of alerting about a problem. This patch fixes the code. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Denis Efremov <efremov@linux.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rwxr-xr-xscripts/coccicheck5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/coccicheck b/scripts/coccicheck
index 9fedca611b7f..e04d328210ac 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -128,9 +128,10 @@ run_cmd_parmap() {
128 fi 128 fi
129 echo $@ >>$DEBUG_FILE 129 echo $@ >>$DEBUG_FILE
130 $@ 2>>$DEBUG_FILE 130 $@ 2>>$DEBUG_FILE
131 if [[ $? -ne 0 ]]; then 131 err=$?
132 if [[ $err -ne 0 ]]; then
132 echo "coccicheck failed" 133 echo "coccicheck failed"
133 exit $? 134 exit $err
134 fi 135 fi
135} 136}
136 137