Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp76540imm; Fri, 10 Aug 2018 07:53:31 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyE+hR2hQS0l0jBKNQCBqS4qmrxTPm1FWSvKwYD7Orc23jcbjdZSPJ7mOUoqdh+efL4odfM X-Received: by 2002:a62:5b85:: with SMTP id p127-v6mr7517450pfb.33.1533912811443; Fri, 10 Aug 2018 07:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533912811; cv=none; d=google.com; s=arc-20160816; b=k/vEcgqxEl/w7qLJXdDwnsiHtV4b6W+eY3qWPv6aVHO3d8SShebcVijbAMlH+3GBnr 9knRtOvzSDgCNkpK6hkcmtMm7wPKThV3LFsSAKZaezfw6jG4x9x2Z0WKFV/O9wcWMffi 1NwsjMHDZ0EsSElxIeNheA1VwdcynH8H3cgijbqXhOCysZKGKi06T9+FDBtlYm8jppKe PP3IftmasJReZOYFe7fMUb0jaJAqKBh2us9seB6kx0ySvBSQA/kIXzmm7BwiUTuz5AFL ea7tc+piyKaTYYQdRpu5RgYA/gSUkblRMmyXk5jnhryYvG6aJRA5QtQAAvH4N0wOtT92 Amow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=nC64HXh9s6xAhuP0k6nSaDLdVfafxPhLHIo55xqvySs=; b=iJxfWe/X6rxksgc4lJ3hJ50zLU7RProkxLuNglfdNxWsk/A8qE6aCGGRoTDfMpUils eBrexNvoW0u8fyr+nAd66kCgmwk3VC/HlZfvz8YNyWOcfEsUn1PXFr0+EP7KnYy82sYe Bbmoj/+yOZrtZ7s/IYpZq3uii0gCbT7BbCbnLOkeN5yyQV+cXez8AS35f8RA71lXDTrf PJDx/csu/1K1KBSToA9i76q7ujkBbmxPxYa3jDoAlKfmafMwl2/wqbI3M+fv1KLzdGii RrHTtDCM9rs3iS2435HbAsTpNRHNTgAlKpfVtkhtLirzs6/qvgSDAPmRwbvJQPvElFcw WbAw== 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 z17-v6si10383939pgk.183.2018.08.10.07.53.16; Fri, 10 Aug 2018 07:53:31 -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 S1728460AbeHJQHH (ORCPT + 99 others); Fri, 10 Aug 2018 12:07:07 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:33751 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727534AbeHJQHH (ORCPT ); Fri, 10 Aug 2018 12:07:07 -0400 Received: by mail-ed1-f65.google.com with SMTP id x5-v6so4801801edr.0 for ; Fri, 10 Aug 2018 06:37:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nC64HXh9s6xAhuP0k6nSaDLdVfafxPhLHIo55xqvySs=; b=Vil6cZPCbZ6WUpAgvdSGzjZ+eW8QiAOQBreuhTppYHwk8zS7esUhuZVfGuNVwXizPr cSVCZEY05676cbjydy1zGde/EXkJGQiIR9si4NWB53SgdCGdF7wPRjSEZzaOiwAgT5KH vW7c+9LO3tZz3gSNRzf4Ya7h6tjFUsnHPWIlc5iJs1B3OSCZZwc378E04/TQzVNZzdQA b1195ajlPttU2p9eEUsas8OmmMpv5WgVuhMZqUGS2hxJTEW0IpvbNanB5tv3qm98YWYu 3Zktk2ShwZbGCVYs7jzk8EI/2XKsLi9dXLu9QHLuj7w1MD8+7+NbSZVBXyDcNniKgJ6e db2g== X-Gm-Message-State: AOUpUlEhPL1lolXXRXrEPc3t3/sl+Ka3m/2C3uOEvw+ILMmFi1t4I6fp Oj08Cs2sY0z9JpgPBoel1a0= X-Received: by 2002:aa7:da16:: with SMTP id r22-v6mr8483480eds.54.1533908229338; Fri, 10 Aug 2018 06:37:09 -0700 (PDT) Received: from green.intra.ispras.ru (bran.ispras.ru. [83.149.199.196]) by smtp.googlemail.com with ESMTPSA id u25-v6sm6488052edm.45.2018.08.10.06.37.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Aug 2018 06:37:08 -0700 (PDT) From: efremov@linux.com To: Julia Lawall Cc: Masahiro Yamada , "Luis R . Rodriguez" , Nicolas Palix , Gilles Muller , Michal Marek , linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org, Denis Efremov Subject: [PATCH] coccicheck: return proper error code on check fail Date: Fri, 10 Aug 2018 16:36:36 +0300 Message-Id: <20180810133636.8340-1-efremov@linux.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If coccicheck finds errors, it should return an error code distinct from zero. Current code instead of exiting with an error code of coccinelle returns error code of 'echo "coccicheck failed"' which is almost always equals to zero, thus failing original intention of alerting about errors. This patch fixes the problem. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Denis Efremov --- scripts/coccicheck | 5 +++-- 1 file 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() { fi echo $@ >>$DEBUG_FILE $@ 2>>$DEBUG_FILE - if [[ $? -ne 0 ]]; then + err=$? + if [[ $err -ne 0 ]]; then echo "coccicheck failed" - exit $? + exit $err fi } -- 2.17.1