From patchwork Thu Feb 25 14:49:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Dunlap X-Patchwork-Id: 8423851 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 33FF0C0553 for ; Thu, 25 Feb 2016 14:51:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7FCEC2035B for ; Thu, 25 Feb 2016 14:51:57 +0000 (UTC) Received: from lists.xen.org (unknown [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A851F2020F for ; Thu, 25 Feb 2016 14:51:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aYxEF-00085R-V0; Thu, 25 Feb 2016 14:49:19 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aYxEE-00084M-My for xen-devel@lists.xen.org; Thu, 25 Feb 2016 14:49:18 +0000 Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id 79/B4-02984-E641FC65; Thu, 25 Feb 2016 14:49:18 +0000 X-Env-Sender: prvs=856900a8f=George.Dunlap@citrix.com X-Msg-Ref: server-3.tower-27.messagelabs.com!1456411755!26405207!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 47653 invoked from network); 25 Feb 2016 14:49:17 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 25 Feb 2016 14:49:17 -0000 X-IronPort-AV: E=Sophos;i="5.22,498,1449532800"; d="scan'208";a="341078882" From: George Dunlap To: Date: Thu, 25 Feb 2016 14:49:00 +0000 Message-ID: <1456411743-17741-6-git-send-email-george.dunlap@eu.citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456411743-17741-1-git-send-email-george.dunlap@eu.citrix.com> References: <1456411743-17741-1-git-send-email-george.dunlap@eu.citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: George Dunlap , Ian Jackson , Wei Liu , George Dunlap Subject: [Xen-devel] [PATCH 5/8] tools/xenalyze: Fix check for error return value X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP fdopen returns NULL on failure, not a negative integer. CID 1306863 CID 1306858 Signed-off-by: George Dunlap Acked-by: Ian Jackson --- Strangely, coverity counted this as two bugs: one for comparing a pointer with a negative integer, one for the comparison never possibly being true (thus making the if condition dead code). CC: Ian Jackson CC: Wei Liu --- tools/xentrace/xenalyze.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c index 123030a..249bebd 100644 --- a/tools/xentrace/xenalyze.c +++ b/tools/xentrace/xenalyze.c @@ -9029,7 +9029,7 @@ void progress_init(void) { opt.progress = 0; } - if( (G.progress.out = fdopen(G.progress.pipe[1], "w")) < 0 ) { + if( (G.progress.out = fdopen(G.progress.pipe[1], "w")) == NULL ) { fprintf(stderr, "%s: could not fdopen pipe: %s, disabling progress bar\n", __func__, strerror(errno)); opt.progress = 0;