Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3085059rwb; Mon, 15 Aug 2022 17:45:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR7SHvbWbHjQENZE+hMV1KCn4eKu4pSixVFXfzjMJhQ4iSV/YPm+1TvB2JxStbJgg3PwJnz2 X-Received: by 2002:a17:907:6e9f:b0:730:e923:a378 with SMTP id sh31-20020a1709076e9f00b00730e923a378mr12066049ejc.71.1660610747144; Mon, 15 Aug 2022 17:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610747; cv=none; d=google.com; s=arc-20160816; b=TSPKRlmQwJI2mzuUAB0HjcrC96f0qsEooyj6jQRdUovwICWunjMYOBrz9xg/4Hxbk7 V5teabj+avNgK8kQE9jPwApIyNTVWh31f4OzcelomrI18Q1T2USwXVQMe+UGO0Ogg+9W sP121V1IK1w2oJNbx5qZ6dPitircbdigw9JLcZKz7nHI/ZiJWsYbu90oTEJGtLTX0MiQ BcWDB9FdxWpYKr/04YhdQ+gqPjP2Hwn+qNU5LIBnw4+lDg75wXYjTPyjoej1NSGpp4fB H/1xk4T8EFqCBJ2BVG0wRONDFe5a66VCqPxlkrDjsQPZrkbwoWfJ5kRCx2/Kro8X0zOX 9eeg== 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=cKI871a3j42KvpuLvBR+kBUvIElWZNwyjycKo6t7RbALHEr/EAwO61NfSGGF+b748S NFrmr8S3IFFxclrJ2ty43m5rF65R9zSqOZVHx3YDj5PwBpexI7W+AJYyv23Zn6U27q+1 ME1lz9fKeOK1JwyPS1gpFAcyocOHRg0FOO8XCg/U7AHAFdxFSombhT8DsVVpIZMwaDuW JdnOTpoV3NLv1KojSqPSmSU6VO1+eLcR4vsxVxBdasMX97eCIxmgGZiyRcSCzFkLm6L7 hLOZ23yjGi2r756P0imK//ZG4ByfFzV/6I1xsZKedY/G1AepoW7yjXydpDeVKt0x93R5 RedA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xmhlj9sz; 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 d3-20020a170906174300b0073304017857si8505162eje.171.2022.08.15.17.45.21; Mon, 15 Aug 2022 17:45:47 -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=Xmhlj9sz; 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 S1344378AbiHOXII (ORCPT + 99 others); Mon, 15 Aug 2022 19:08:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240571AbiHOXEo (ORCPT ); Mon, 15 Aug 2022 19:04:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 566BF140C83; Mon, 15 Aug 2022 12:58:38 -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 7DFB760FB5; Mon, 15 Aug 2022 19:58:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E15BC433D6; Mon, 15 Aug 2022 19:58:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593516; bh=H4/hsVFJqPIVHOEuLSJ+W+AOG4ouYb+3A7WRi0QKwP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xmhlj9szUeru1QfeDntycxOXscEuabPgzeJ2hFZOE4WgdFuGi0ha/dyB0bgndwhQP mRTY88VB9Z4s3HMmZfBEV5IfN1S0fpRAkC2LuC+K6orx980BtSihUPsHBrHPtzyMT+ eWumq8Q1cg9RTIdznWz3bybnuw/Vf1i5QJsO9Ldo= 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.18 0961/1095] scsi: qla2xxx: Fix imbalance vha->vref_count Date: Mon, 15 Aug 2022 20:06:00 +0200 Message-Id: <20220815180508.839080213@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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),