Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp729476imm; Thu, 13 Sep 2018 06:57:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY9T/zQ9aHev4s/nUsEAdhz3IsjxrkH9LD2stmkxgm6mMlFFOZ2UUDHO8df2KupKNnLEWpt X-Received: by 2002:a17:902:7896:: with SMTP id q22-v6mr7334924pll.47.1536847022211; Thu, 13 Sep 2018 06:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847022; cv=none; d=google.com; s=arc-20160816; b=beFEbro1JpLDvAXu98CuiG1PxQHJxjAt0R3ioCXWPee9N9iUiCEXsicAhygzrW6Exp 6Nxl+iCTgPYzWuov6eobGHGVKeb/891qYRxVgCBBi8rY2CAhMyov7xpLZE0YcH3baMfT fNcsWZW4bueGtZ07qH6LzbOWdDDuFOIB/xTtu7dWTolKmK3RjK9kRNoQ4fV3AqMxViuj s5w/LmBMH9zIWfvhMeOQBhBBYR5+rcNrQI7hxvodJeC0C29vYlFHrH6YYtDhm0Afp3Dl zyIfwBIKDXjSnp3PGA9JlG49Ai4JGD32CZvP8f/m4MomMK6PMieju+OhFfwnUsKO7c0H nIIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=HyQ2iWTRktYjlk1VFGLAbUY6Qcz63outA4QDaOXEbrM=; b=rsb/gMowFqz+rxe1dUwJj/7YcOQIxDK9+LbQISzD3VofO48ykDBDYZJKiObO0XMa9i 9ju+tdpiCD+wfsUpuJEUjAYNhRvB9AyHHx4jxHngdPZiUBdHu0Bi+97T7j2N4C3Ff+Dm iqsAxfKyUBbcWQKaPTgdMGrrBW3yx4TmNJaux/rx6RFAUftnMAzv4Es8Z4SoNgGVCw// n3KQwayt3596txJpi16uX4EQvkAJP79wRkk7ttTLDoiLXzABceQIiBEGnqpapWQicvxg DSir+q4HEBhNZWxwgwH6hlXkmZq+rUa5d4JnWM1lU7rb8mP1z+ifhLBUawWk8vq0yqvL W13A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9-v6si4281931pgm.428.2018.09.13.06.56.47; Thu, 13 Sep 2018 06:57:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731375AbeIMTFw (ORCPT + 99 others); Thu, 13 Sep 2018 15:05:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34144 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729823AbeIMTFw (ORCPT ); Thu, 13 Sep 2018 15:05:52 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0473DCE7; Thu, 13 Sep 2018 13:56:15 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Denis Efremov , Julia Lawall , Masahiro Yamada , Sasha Levin Subject: [PATCH 4.18 086/197] coccicheck: return proper error code on fail Date: Thu, 13 Sep 2018 15:30:35 +0200 Message-Id: <20180913131844.974207495@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Denis Efremov [ 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 Acked-by: Julia Lawall Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- 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 }