Received: by 10.213.65.68 with SMTP id h4csp442065imn; Tue, 13 Mar 2018 09:10:09 -0700 (PDT) X-Google-Smtp-Source: AG47ELsDtndNg6Wwy2IijzPthSo+/DS5Vt1YX37MstWWi/O/yNM8IEsIP4m9NRlbdwTWEgBdoaaS X-Received: by 10.99.126.20 with SMTP id z20mr931059pgc.38.1520957408943; Tue, 13 Mar 2018 09:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520957408; cv=none; d=google.com; s=arc-20160816; b=P4GYMItHd+mr++/e0bCLgmostjFxSH5nXEu/Y9LrZ0QBrl48dDfanRh6L6zjkWar/a 6ZKHafCIqwCdlBk58/JDqRPVJeX3KvdVFcVuAL+rs3GskooKggEL9QAc+ncjR3gaufaf 3ALF6lo27DZmD1uo8cozHrbQzvI5Lqn9WQKG20uyl0JBsvLcAc/bOd3dStcXnZZVQFc7 OTbuHZ1yqGNsdHw2bvUf3e//qVGdeZNTaZF/98nwFj1rGMqYvVr0CDVyEPfTrwU0cr+a DwMul6PMysoyG8r8j9j2XMv/OD94Ycd2WLCOBjlrLqf6+BwwY8gpQC7bLyJ09gRdOgBn LWSA== 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=pEboMKG3St6a5XmqXWtDidioygUaZgghDzqhTXsyb74=; b=qYFIC3oiRcF/mcXfI+DdO8T/RN+nmDf5tRSqxyuEJweLrEyf/Hm/nMBU2/Sj2NVlpU 0WO1JLwy0QEH7wXdeZpIzCN6JvpQf7T31DnVpH3gQiG0W0CVYuwNy4r590zExuoz8VID GFy/0UfsaB42vRBUbg7RAl3EqB3rZI2+UKerqmXztIjJLJ3UJXv8e2FueQbk+jy2LI95 yHzj/6vRRnrwfxMPqTvXKJ+acEK6bdf/sB7zdcwl4D8znrCUjvMQBwQBkK3we5p+pm3O E3Dq3rwuq7rqfsqP/eexSQIHwvmROrCYKuzaOfJ80QQd8OI47RkMXl45kLP0OM7vMoSS geVw== 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 g92-v6si292922plg.256.2018.03.13.09.09.52; Tue, 13 Mar 2018 09:10:08 -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 S934240AbeCMPga (ORCPT + 99 others); Tue, 13 Mar 2018 11:36:30 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33556 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934168AbeCMPgZ (ORCPT ); Tue, 13 Mar 2018 11:36:25 -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 6066211CC; Tue, 13 Mar 2018 15:36:24 +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.14 032/140] scsi: qla2xxx: Fix NPIV host cleanup in target mode Date: Tue, 13 Mar 2018 16:23:55 +0100 Message-Id: <20180313152500.263801807@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152458.201155692@linuxfoundation.org> References: <20180313152458.201155692@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.14-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;