From patchwork Mon Oct 10 15:27:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9369637 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 264DC607FD for ; Mon, 10 Oct 2016 15:27:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 147EA28C97 for ; Mon, 10 Oct 2016 15:27:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0481C28DEB; Mon, 10 Oct 2016 15:27:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 511E828C97 for ; Mon, 10 Oct 2016 15:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752492AbcJJP1i (ORCPT ); Mon, 10 Oct 2016 11:27:38 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:59702 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752488AbcJJP1i (ORCPT ); Mon, 10 Oct 2016 11:27:38 -0400 Received: from [83.175.99.196] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.85_2 #1 (Red Hat Linux)) id 1btcUL-0005vP-4M; Mon, 10 Oct 2016 15:27:37 +0000 From: Christoph Hellwig To: swise@opengridcomputing.com, linux-rdma@vger.kernel.org Subject: [PATCH] cxgb4: missing dereference in poll_cq Date: Mon, 10 Oct 2016 17:27:33 +0200 Message-Id: <1476113253-16880-1-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sparse complains about using plain integer as NULL pointer here, but I suspect we really want to check the value anyway, and Steve confirmed that's indeed the case. Signed-off-by: Christoph Hellwig Acked-by: Steve Wise --- providers/cxgb4/cq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/cxgb4/cq.c b/providers/cxgb4/cq.c index 1ed7dfd..3c8dd26 100644 --- a/providers/cxgb4/cq.c +++ b/providers/cxgb4/cq.c @@ -438,7 +438,7 @@ static int poll_cq(struct t4_wq *wq, struct t4_cq *cq, struct t4_cqe *cqe, if (!*cqe_flushed && CQE_STATUS(hw_cqe)) dump_cqe(hw_cqe); - BUG_ON((cqe_flushed == 0) && !SW_CQE(hw_cqe)); + BUG_ON((*cqe_flushed == 0) && !SW_CQE(hw_cqe)); goto proc_cqe; }