From patchwork Tue Jul 10 17:31:59 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: 10517877 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 C006D6054E for ; Tue, 10 Jul 2018 18:36:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B755928C80 for ; Tue, 10 Jul 2018 18:36:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB80C28FA4; Tue, 10 Jul 2018 18:36:45 +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 5F83B28C80 for ; Tue, 10 Jul 2018 18:36:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390066AbeGJSg5 (ORCPT ); Tue, 10 Jul 2018 14:36:57 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:37595 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389998AbeGJSg4 (ORCPT ); Tue, 10 Jul 2018 14:36:56 -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=1531247803; x=1562783803; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=TUfLIHUUGPBMHbNplbD94eLvj033TR1cmPt9s8LytrA=; b=VCDhkdoSFJM3qUrP5lGOsqTPY2MbGRBQ2UVZjn6Gh4aT1P3DPhAqE2WF TSEB2aiPq5L68bYA1o5Zj/y2JCifshcuuAtilMqoNa4BJvIhAvDJjgubf r2elv+lllq7NUBizb/w3bcpNo+7l1HSBZI+UROFnhLbBAwNC1MZFa/bx6 GDDTmv9t4UcnWPJIh2Dhd0LAxTOn48l1KvvbnZ0/nKG/LEliGGK9yDRgp TlJYXPoF4jyJ6YeFYeDknbba6hnKTuNTHYVxcNiYwe9EYqUAOkbTYAz/4 ulqnYkllJ6jwpCEZyk2jcfWrRE9DVwxZQpE5R1CqFoXg2dRMtMXmX+jm0 Q==; X-IronPort-AV: E=Sophos;i="5.51,335,1526313600"; d="scan'208";a="83636448" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 11 Jul 2018 01:32:01 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 10 Jul 2018 10:21:02 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip01.wdc.com with ESMTP; 10 Jul 2018 10:32:01 -0700 From: Bart Van Assche To: Jason Gunthorpe Cc: Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , stable@vger.kernel.org Subject: [PATCH 2/3] IB/srpt: Fix srpt_cm_req_recv() error path (2/2) Date: Tue, 10 Jul 2018 10:31:59 -0700 Message-Id: <20180710173200.19853-3-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180710173200.19853-1-bart.vanassche@wdc.com> References: <20180710173200.19853-1-bart.vanassche@wdc.com> 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 If a login request was received through the RDMA/CM and if an error occurs during login, clear rdma_cm_id->context instead of ib_cm_id->context. Fixes: 63cf1a902c9d ("IB/srpt: Add RDMA/CM support") Signed-off-by: Bart Van Assche Cc: --- drivers/infiniband/ulp/srpt/ib_srpt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index e95d0c1c0652..325bae29e90d 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -2361,8 +2361,11 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev, srpt_free_ioctx_ring((struct srpt_ioctx **)ch->ioctx_ring, ch->sport->sdev, ch->rq_size, ch->max_rsp_size, DMA_TO_DEVICE); + free_ch: - if (ib_cm_id) + if (rdma_cm_id) + rdma_cm_id->context = NULL; + else ib_cm_id->context = NULL; kfree(ch); ch = NULL;