[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180913131844.974207495@linuxfoundation.org>
Date: Thu, 13 Sep 2018 15:30:35 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Denis Efremov <efremov@...ux.com>,
Julia Lawall <julia.lawall@...6.fr>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Sasha Levin <alexander.levin@...rosoft.com>
Subject: [PATCH 4.18 086/197] coccicheck: return proper error code on fail
4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Denis Efremov <efremov@...ux.com>
[ Upstream commit 512ddf7d7db056edfed3159ea7cb4e4a5eefddd4 ]
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@...ux.com>
Acked-by: Julia Lawall <julia.lawall@...6.fr>
Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
Signed-off-by: Sasha Levin <alexander.levin@...rosoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
scripts/coccicheck | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -128,9 +128,10 @@ run_cmd_parmap() {
fi
echo $@ >>$DEBUG_FILE
$@ 2>>$DEBUG_FILE
- if [[ $? -ne 0 ]]; then
+ err=$?
+ if [[ $err -ne 0 ]]; then
echo "coccicheck failed"
- exit $?
+ exit $err
fi
}
Powered by blists - more mailing lists