Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3094945rwb; Mon, 15 Aug 2022 18:00:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Mi7BB0H+Xf1bHz4M307gQzm0o3CAlVmSps03qc0tEyv+wZkpj13wexp0W+05fR+r3IDnY X-Received: by 2002:a05:6402:e94:b0:443:e3fe:7c87 with SMTP id h20-20020a0564020e9400b00443e3fe7c87mr4097191eda.144.1660611632338; Mon, 15 Aug 2022 18:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611632; cv=none; d=google.com; s=arc-20160816; b=YStLhl2sbgmdBbYp1mUJuDn1ZylN8ReXRXytosfBzCd4Cabcjlp2bGiYd0rUGxAGCA KAx9yH9MahnBVFjIuioe/8S9k2/7MxK/FbXDaEaLKYdFu8ISRnoejlLclnFPMoq9T6AU N502NaZ0/CqUsKw1Dnzq+y+aU4u8WC6vsk7oCSDQNdFLyGh3s9X1Tjm97Cidt5q3lKIr ZJCtcpQGYFpmZagrfKjMl3KxNTsLt7py2WswqgzQjTQVh50wiNGwfvMeI2ylNvLRvEsH YVhcDtXtS0mEibE/5qCAQ7zMIJb33rEPqlXnCFrbJIJV2y+y4I5FDUEYaP0RY3Jh3uhF 5ysA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bQQw36JDaXgasqbYxrJuW79k6mEvCw+wUOqeHscwyac=; b=QeQbqbUwrZq/1axVhxO+8WcfqjfaOSORDtIJie/cTrJlumr9t7z7yg9BR1GpoaBL41 wl7uZ5H06xrzNvucIsP1Nnz9PBGcA/S/pmMNMt1Sbakb8WZ5pWqG2Ayark32ILi/KShd SgTjAxvK8vfeuiCfl913A0XS0028VdGwZtDfy9K/HHwK2pAQGlqwqgN+vmHB6/1QZMaZ 6Sv5Fmm00Poy/IvBo/HE524IDDvxhSeR1zCT/JD91ik2cpPNGsVf14+8UGfnvEZnrefs +lrnqcu1V7iflSJLlg1qXTrollVmR9cVFZQp/KzxP3Os7lZpRTOek7AhZD2q8s242Si4 FQGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PdD9eBVJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 9-20020a170906200900b0072b4b197fa4si8897903ejo.88.2022.08.15.18.00.06; Mon, 15 Aug 2022 18:00:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PdD9eBVJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347935AbiHPAv5 (ORCPT + 99 others); Mon, 15 Aug 2022 20:51:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349214AbiHPAqc (ORCPT ); Mon, 15 Aug 2022 20:46:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3112D87DA; Mon, 15 Aug 2022 13:45:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 729306125E; Mon, 15 Aug 2022 20:45:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73E00C433D6; Mon, 15 Aug 2022 20:44:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596299; bh=H4/hsVFJqPIVHOEuLSJ+W+AOG4ouYb+3A7WRi0QKwP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PdD9eBVJgKKVQ5wyK8kc3zJjItddAm3KxwjoY4GTXAzIlazGnuGiPCStFcv3tNG9e Bl/SwbAjD4YrO1RLcbfckXAkqh+Di/PJmIbFtUN8UvS5ZdIxL2QAFp8BfbYSNlDyAb 9TcX7s/oQnMWiCH38GIZwgYwcooLuqZWk8DYHTpc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Himanshu Madhani , Quinn Tran , Nilesh Javali , "Martin K. Petersen" Subject: [PATCH 5.19 1035/1157] scsi: qla2xxx: Fix imbalance vha->vref_count Date: Mon, 15 Aug 2022 20:06:31 +0200 Message-Id: <20220815180521.374960798@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Quinn Tran commit 63fa7f2644b4b48e1913af33092c044bf48e9321 upstream. vref_count took an extra decrement in the task management path. Add an extra ref count to compensate the imbalance. Link: https://lore.kernel.org/r/20220713052045.10683-7-njavali@marvell.com Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_init.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -161,6 +161,7 @@ int qla24xx_async_abort_cmd(srb_t *cmd_s struct srb_iocb *abt_iocb; srb_t *sp; int rval = QLA_FUNCTION_FAILED; + uint8_t bail; /* ref: INIT for ABTS command */ sp = qla2xxx_get_qpair_sp(cmd_sp->vha, cmd_sp->qpair, cmd_sp->fcport, @@ -168,6 +169,7 @@ int qla24xx_async_abort_cmd(srb_t *cmd_s if (!sp) return QLA_MEMORY_ALLOC_FAILED; + QLA_VHA_MARK_BUSY(vha, bail); abt_iocb = &sp->u.iocb_cmd; sp->type = SRB_ABT_CMD; sp->name = "abort"; @@ -2007,12 +2009,14 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, struct srb_iocb *tm_iocb; srb_t *sp; int rval = QLA_FUNCTION_FAILED; + uint8_t bail; /* ref: INIT */ sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); if (!sp) goto done; + QLA_VHA_MARK_BUSY(vha, bail); sp->type = SRB_TM_CMD; sp->name = "tmf"; qla2x00_init_async_sp(sp, qla2x00_get_async_timeout(vha),