Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6132195iog; Thu, 23 Jun 2022 12:02:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uZwN3lvJTUt4vdYJ6XFH94+ehlDHxzBUB6tlPzV57bvv+SDRG5LssiP5fXxS1AWa3Vl3T1 X-Received: by 2002:a05:6402:1bcb:b0:435:8ec1:a580 with SMTP id ch11-20020a0564021bcb00b004358ec1a580mr12854157edb.68.1656010927348; Thu, 23 Jun 2022 12:02:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656010927; cv=none; d=google.com; s=arc-20160816; b=XGBCrzEtOCcr/LweiDnieVdoU5qw4EaQZX4aVXviIrgOyn9kw8Q3sLUi2beSCvT5vP 3k8YbQ0Mx4qA4wfCaomYOl6nh5KdFijhxnMQ8h0LY1FYjHBQuydtdze6fGbZr2P1LFPB igpkFbmaYFf1Wp469F2PLt3w09jreQbjzuYj9/LhJH6Uuxc2fj2uNdEyspFoUE0hVmth BWnDWT0fPAgzAVcZ5lFjrJKMoAczShafwNOXhf3u95UCyH66vKNhPK5C9TMivalvyJ40 yVtnt0MRWfqf+URkz2pE4bBiPIPlMUuUKLzSIJC1jpto55qNr8YT4QX/ZW48v8fBgzQ1 ZXtA== 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=iKmQNwT9d8AnlXIWS1eQSUpjD9XL01cuveJdx9Uwo0g=; b=xrmWnt+UV59lm+KgdrWKqA6AP39c74E/bhC0fB+ybSIFeuLMGbVgzzIc+7Xdc8AvFw hJw7NJJ6AiDIUsxE6+AIlD1A8Lpww6kDdu0DWRiX08zSRKuveaC4JQ1aZJA2l7vYpiAc mM2cRUP2gU6jmIVDkfbeFhEPz/yrxygTlnyRRIc/HyaQkHrPJgMOJkEFjjjxo9P5hvxm TcDMlbkYU3K7UCp/Ofn2gNdRLrx4Mp+Qdb9jom7k95fuGCtULozCHrPz+Ql3gFn7JJ10 DpByjzNYYhW2JSPbmw4lpnIGvlpMTsRDb/h3ZIFIXWQrkoLUcV9tZUd+tP5xrRn4utF0 3VOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JhI1IS6d; 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 e8-20020a17090658c800b00712163df510si7005791ejs.236.2022.06.23.12.01.39; Thu, 23 Jun 2022 12:02:07 -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=JhI1IS6d; 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 S234375AbiFWSQX (ORCPT + 99 others); Thu, 23 Jun 2022 14:16:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236694AbiFWSPm (ORCPT ); Thu, 23 Jun 2022 14:15:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA24D828A9; Thu, 23 Jun 2022 10:22:02 -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 7FD8261DE5; Thu, 23 Jun 2022 17:22:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5128DC3411B; Thu, 23 Jun 2022 17:22:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004921; bh=Z/bU1EntVyuSsKMlpIaPPhcqMGerETGyWjEkmgHMzi8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JhI1IS6dEahi6odbm/u1YkqoLxfIpWrWkL3geFZos5Gi0ghaQNX98MMpdiUzdPtV2 +Bj4nD9z+6+GZF7w9a5Vms7oOAW96624yh3uVKE3LFIBXHYfQMVISdM3GUHTxRexI2 fmRWaSKRapLAWUZH/NppeIcq4WzZ9bCwVdY7LBvg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Chengguang Xu , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.19 193/234] scsi: pmcraid: Fix missing resource cleanup in error case Date: Thu, 23 Jun 2022 18:44:20 +0200 Message-Id: <20220623164348.509856650@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 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: Chengguang Xu [ Upstream commit ec1e8adcbdf661c57c395bca342945f4f815add7 ] Fix missing resource cleanup (when '(--i) == 0') for error case in pmcraid_register_interrupt_handler(). Link: https://lore.kernel.org/r/20220529153456.4183738-6-cgxu519@mykernel.net Reviewed-by: Dan Carpenter Signed-off-by: Chengguang Xu Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/pmcraid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index 4e86994e10e8..6e96229c58e0 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -4559,7 +4559,7 @@ pmcraid_register_interrupt_handler(struct pmcraid_instance *pinstance) return 0; out_unwind: - while (--i > 0) + while (--i >= 0) free_irq(pci_irq_vector(pdev, i), &pinstance->hrrq_vector[i]); pci_free_irq_vectors(pdev); return rc; -- 2.35.1