From patchwork Tue Jun 26 15:39:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10489421 X-Patchwork-Delegate: jgg@ziepe.ca 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 272C56031B for ; Tue, 26 Jun 2018 15:39:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1702A274D0 for ; Tue, 26 Jun 2018 15:39:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A6EF27F90; Tue, 26 Jun 2018 15:39: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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 94FBC274D0 for ; Tue, 26 Jun 2018 15:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752005AbeFZPji (ORCPT ); Tue, 26 Jun 2018 11:39:38 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:29864 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751074AbeFZPjh (ORCPT ); Tue, 26 Jun 2018 11:39:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1530027577; x=1561563577; h=from:to:cc:subject:date:message-id; bh=Z8p1gyxUX/e20owark9YJn+7LbF4byhDliLaubGFYDo=; b=UzB9PIRFoyPnHTYza+hgoGDleSd/VJH84CPDRlLxPXP02ryCcp5+ARnb jNgdLfIEbjEra7PsG22wjuDDqmQYpOFWVn0aK5w/1qgtChqV1WchNid7h tcp3q1ZYIFNv8NqKYkrYpdLnZbVuK7w//+PPkNFML25zyU3KG+bQeikjk Q10JUhvHcgDjH9jgB2+f9yMVjl/5hWLQI3bXdwGoFsP/fIrUIh9FlxnJ2 jiyIctJ8d66r13i0o7/Wxb0Z+0MaaIgqi4dOR7i34zTZKIAo6YntauFCd /wVfoa0FKp7jbKOh/piPMs9n9Y0u/iPYkkJEee6gh8kYoxCeABsY2lMJs w==; X-IronPort-AV: E=Sophos;i="5.51,274,1526313600"; d="scan'208";a="185413444" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 26 Jun 2018 23:39:36 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 26 Jun 2018 08:29:11 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip01.wdc.com with ESMTP; 26 Jun 2018 08:39:37 -0700 From: Bart Van Assche To: Jason Gunthorpe Cc: Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Zhu Yanjun , Jianchao Wang , Yuval Shaia , stable@vger.kernel.org Subject: [PATCH v2] RDMA/rxe: Set wqe->status correctly if an unexpected response is received Date: Tue, 26 Jun 2018 08:39:36 -0700 Message-Id: <20180626153936.9576-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.17.1 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 Every function that returns COMPST_ERROR must set wqe->status to another value than IB_WC_SUCCESS before returning COMPST_ERROR. Fix the only code path for which this is not yet the case. Signed-off-by: Bart Van Assche Cc: Zhu Yanjun Cc: Jianchao Wang Cc: Yuval Shaia Cc: --- Changes compared to v1: left out a pr_err() statement as requested by Jason. drivers/infiniband/sw/rxe/rxe_comp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c index 98d470d1f3fc..83311dd07019 100644 --- a/drivers/infiniband/sw/rxe/rxe_comp.c +++ b/drivers/infiniband/sw/rxe/rxe_comp.c @@ -276,6 +276,7 @@ static inline enum comp_state check_ack(struct rxe_qp *qp, case IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE: if (wqe->wr.opcode != IB_WR_RDMA_READ && wqe->wr.opcode != IB_WR_RDMA_READ_WITH_INV) { + wqe->status = IB_WC_FATAL_ERR; return COMPST_ERROR; } reset_retry_counters(qp);