Received: by 10.213.65.68 with SMTP id h4csp448555imn; Tue, 13 Mar 2018 09:22:21 -0700 (PDT) X-Google-Smtp-Source: AG47ELvaXlaUuFLRXh+AE315szJn9578WPa6y7ue56JUg3/x/e5Y4js1OZpGQWkj/VCUi3JhkK8X X-Received: by 10.99.128.67 with SMTP id j64mr929684pgd.55.1520958140978; Tue, 13 Mar 2018 09:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520958140; cv=none; d=google.com; s=arc-20160816; b=lqiBit9bc3IEztVAloLnDbE4bJj+PLt3TZ17Qo2E9tviHaNN3WpoLvdq7WCQaZcGUi Eleuo71XhWkEzRPqsGJZ9fZYKuGt6LeMP+ZuxlpTXfoCfwJ9iKmS901h+SHAYWXVNezG kQpsrD1b8rccHGY589a0+mKhxhNgHqxJgj46vH4e04mRz5CTcyNrcrkwjxYvYrhOR2lv X9lSwr0NNBEkR2mCT9cxrGveRWQbhcrzkTwuJyIifuxFOI84Xex0PrHX6jk83/Hy/2Du 4yavo1fr7LeOaldebF2DWZ90YmfD2iVRhv7IOZB4OMDa/pli6+bqi0euZDUggE7IkTq4 fDNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Rte0/uiiS/0FgrvDOX0D9AIeysU577ZilEeozCvJKtc=; b=lPmw1cUWwq87IOzKhyY6AmfV30NFCnRAKiPzs2e8IQVgO4g9t+fwAZCqfgXxmAm3+3 5PYlCA3x2xb2wHpfazoVzspkL3TKBB/MrPlT1C3KHGFx5wWMjwVdBpjXrqXo2DHjCwHg GXmLMB3dOInCVl9rWtsR0HFZ897IZdBn6hRX7A8wkbd6Wtm9BBHbzIUZc84R9hHyIyOx ssV8q0BqK/haf18LwTkXSSedHCQijFvGAri/FGR4ssra8GKdYi7eqm197RtnM3m0kYoG d26V5KczDd/u8WGwgiiBO+Jo/0yGq2HQChnboHujzJeZ8Q/KRAsgYqscKFTFRrwTIMx+ 5opg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si278337pgq.417.2018.03.13.09.22.01; Tue, 13 Mar 2018 09:22:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933888AbeCMQTy (ORCPT + 99 others); Tue, 13 Mar 2018 12:19:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:32902 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933819AbeCMPeo (ORCPT ); Tue, 13 Mar 2018 11:34:44 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4B6741079; Tue, 13 Mar 2018 15:34:43 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sawan Chandak , Himanshu Madhani , Hannes Reinecke , "Martin K. Petersen" Subject: [PATCH 4.15 132/146] scsi: qla2xxx: Fix NPIV host cleanup in target mode Date: Tue, 13 Mar 2018 16:24:59 +0100 Message-Id: <20180313152330.341300494@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152320.439085687@linuxfoundation.org> References: <20180313152320.439085687@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sawan Chandak commit 3be63b1e1838e35ce93e83f19573e949f4b389b4 upstream. Add check to make sure we are cleaning up global target host list only for NPIV hosts Fixes: bdbe24de281e2 ("scsi: qla2xxx: Cleanup NPIV host in target mode during config teardown") Cc: # 4.10+ Signed-off-by: Sawan Chandak Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_target.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1561,8 +1561,11 @@ static void qlt_release(struct qla_tgt * btree_destroy64(&tgt->lun_qpair_map); - if (ha->tgt.tgt_ops && ha->tgt.tgt_ops->remove_target) - ha->tgt.tgt_ops->remove_target(vha); + if (vha->vp_idx) + if (ha->tgt.tgt_ops && + ha->tgt.tgt_ops->remove_target && + vha->vha_tgt.target_lport_ptr) + ha->tgt.tgt_ops->remove_target(vha); vha->vha_tgt.qla_tgt = NULL;