From patchwork Thu Oct 30 13:46:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 5197781 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9297AC11AC for ; Thu, 30 Oct 2014 13:46:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A131B201CD for ; Thu, 30 Oct 2014 13:46:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A1C320158 for ; Thu, 30 Oct 2014 13:46:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760130AbaJ3Nq3 (ORCPT ); Thu, 30 Oct 2014 09:46:29 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:52384 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759908AbaJ3Nq2 (ORCPT ); Thu, 30 Oct 2014 09:46:28 -0400 Received: from [192.168.1.117] ([178.117.55.239]) by andre.telenet-ops.be with bizsmtp id 9RmT1p00J59gWLa01RmTq5; Thu, 30 Oct 2014 14:46:27 +0100 Message-ID: <54524133.2060604@acm.org> Date: Thu, 30 Oct 2014 14:46:27 +0100 From: Bart Van Assche User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Christoph Hellwig CC: Jens Axboe , Sagi Grimberg , Sebastian Parschauer , "Martin K. Petersen" , Robert Elliott , Ming Lei , "linux-scsi@vger.kernel.org" , linux-rdma Subject: [PATCH v3 04/11] IB/srp: Move ib_destroy_cm_id() call into srp_free_ch_ib() References: <545240AE.6060009@acm.org> In-Reply-To: <545240AE.6060009@acm.org> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 The patch that adds multichannel support into the SRP initiator driver introduces an additional call to srp_free_ch_ib(). This patch helps to keep that later patch simple. Signed-off-by: Bart Van Assche Reviewed-by: Sagi Grimberg Cc: Sebastian Parschauer --- drivers/infiniband/ulp/srp/ib_srp.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 62d2a18..d3c712f 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -555,6 +555,11 @@ static void srp_free_target_ib(struct srp_target_port *target) struct srp_device *dev = target->srp_host->srp_dev; int i; + if (target->cm_id) { + ib_destroy_cm_id(target->cm_id); + target->cm_id = NULL; + } + if (dev->use_fast_reg) { if (target->fr_pool) srp_destroy_fr_pool(target->fr_pool); @@ -868,7 +873,6 @@ static void srp_remove_target(struct srp_target_port *target) scsi_remove_host(target->scsi_host); srp_stop_rport_timers(target->rport); srp_disconnect_target(target); - ib_destroy_cm_id(target->cm_id); srp_free_target_ib(target); cancel_work_sync(&target->tl_err_work); srp_rport_put(target->rport); @@ -3043,7 +3047,7 @@ static ssize_t srp_create_target(struct device *dev, if (ret) { shost_printk(KERN_ERR, target->scsi_host, PFX "Connection failed\n"); - goto err_cm_id; + goto err_free_ib; } ret = srp_add_target(host, target); @@ -3067,9 +3071,6 @@ out: err_disconnect: srp_disconnect_target(target); -err_cm_id: - ib_destroy_cm_id(target->cm_id); - err_free_ib: srp_free_target_ib(target);