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).
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -128,9 +128,10 @@ run_cmd_parmap() { · 127 unmodified lines | |||
| 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 | ||