From patchwork Sun May 29 15:34:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 577172 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86BBAC4332F for ; Sun, 29 May 2022 15:39:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231245AbiE2Pj0 (ORCPT ); Sun, 29 May 2022 11:39:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231206AbiE2PjS (ORCPT ); Sun, 29 May 2022 11:39:18 -0400 Received: from sender2-op-o12.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E43C62CFF; Sun, 29 May 2022 08:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1653838743; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=X/Nq01tIJiL66k1gHdv7dx/ePbQHb3DUAurLiy4DtgY=; b=Fxu+1huBl4/KM9ltkTR62MbYdabZL04hTFCByM3kfUr9KQF+biVFQn04SW5kP1Q1 d5FpcnH+HjpXz3YGGZs8hNGV7vmMhcINJN8I3dyyTu3u5GPC3BA13oZEbKWyod0tHYM x4zAoZp93gXnnqBdI3yIffL8VH3rnYxVVye1HRYM= Received: from localhost.localdomain (81.71.33.115 [81.71.33.115]) by mx.zoho.com.cn with SMTPS id 1653838741319791.7650617890589; Sun, 29 May 2022 23:39:01 +0800 (CST) From: Chengguang Xu To: netdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-scsi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-media@vger.kernel.org Cc: Chengguang Xu Message-ID: <20220529153456.4183738-6-cgxu519@mykernel.net> Subject: [PATCH 5/6] scsi: pmcraid: fix missing resource cleanup in error case Date: Sun, 29 May 2022 23:34:55 +0800 X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220529153456.4183738-1-cgxu519@mykernel.net> References: <20220529153456.4183738-1-cgxu519@mykernel.net> MIME-Version: 1.0 X-ZohoCNMailClient: External Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Fix missing resource cleanup(when '(--i) == 0') for error case in pmcraid_register_interrupt_handler(). Signed-off-by: Chengguang Xu --- 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 3d5cd337a2a6..0007a8a993a1 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -4031,7 +4031,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;