Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3502175rwa; Tue, 23 Aug 2022 05:57:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR7jFz2lTIj5sI7T5FzKYB7yk9HRAI0nhr0Za6ctSqXDZ+KwlBlPkUR/831FO0dUySNiQQA1 X-Received: by 2002:a17:907:3f23:b0:73d:a5a6:1630 with SMTP id hq35-20020a1709073f2300b0073da5a61630mr1200974ejc.730.1661259453530; Tue, 23 Aug 2022 05:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661259453; cv=none; d=google.com; s=arc-20160816; b=njdH5KNM4PQxAqL9rFYZrant0EnC35nlrVs7o5aQuhTi1MPTvQkUbgEon3U38jVIEy 7OczL+bE5ojDTs5K8iukTo11/XHO4LUvnGBbMZRwHU08qbIuFuxzFb9q0pQznRuAXeBa 8Z4ma/YcEhdCWRbVTY+ec8+wJGC2K/7+TY526IpayyJ38WZGwJW400zhIQMByeIQkMah Wu1G8+mj7gcG3LDWu/cWIA5p530mzq5UpT5Kefa/RrC7gFM98bm6BdpI2uSwFmXEW0H6 1ilsiQ1aBzgTaA0DCZ7kL5Jhpoyc1jCd4cgTHFzxHc1abI60VNIOG1IIpkR2zyP0c4K2 zJEQ== 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=2Srha6CESe9DEbl/wYqDszn6Dp78KySHcIg+QRwfS0o=; b=TIL516PblVBXJheOzB4cJ9HWFfQwpOHBXgePSqR3Nrx8Ngbvaq+W0DMJX4DrW0CuXR JozPy+LfJuEuS5fRjXN1/sreVgNdNT0L3U6GxoMR2EDxp4nCeUkCNlvckUYUP5nx/dun uXAMW4LVoenKBFJsf7MpY5DHajLVZDxuTgRLzbrDMkuJ1D8FywXPNbRUM5QrYajNptca 1BUboHPMO1+G6f6tpiMXHqHu5ytUbp199ryqXFh69edmHH/TldpAjKUBCgaNCzhW5MBM Mufx2HFWcw2CVgvSTHVq3JSonffLJlpujC60ugeYikXgmxlU3YnM83zvNdCGDlWJ/ApU Ndpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zkiMt5mZ; 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 bx21-20020a0564020b5500b00446efca2cb9si1926370edb.264.2022.08.23.05.57.06; Tue, 23 Aug 2022 05:57:33 -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=zkiMt5mZ; 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 S242655AbiHWLaM (ORCPT + 99 others); Tue, 23 Aug 2022 07:30:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236564AbiHWLZE (ORCPT ); Tue, 23 Aug 2022 07:25:04 -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 C20BF8C459; Tue, 23 Aug 2022 02:24:01 -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 EBCF5612F4; Tue, 23 Aug 2022 09:24:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA17BC433D6; Tue, 23 Aug 2022 09:23:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661246640; bh=g138Vep1kosQ0akqfkLiqvL+yNeVRxLA3+W5eq/fcb0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zkiMt5mZmH3Q0v73uHUYIbwbir+Qq7szMptawMWhStMlQZBFJXZu1VJpmKnvZW5Tk FoFYVSGP+MMsA+HwTDXJAPwiLVmnglW0MkgVt1VI55DREN2PDfXPvgKMvwrgjHVkb+ oWb7n/FKAbtxgK0gD3oT/2dILat5PfBbLbnq1t+E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , Christophe JAILLET , Alexander Shishkin , Sasha Levin Subject: [PATCH 5.4 174/389] intel_th: Fix a resource leak in an error handling path Date: Tue, 23 Aug 2022 10:24:12 +0200 Message-Id: <20220823080122.909881694@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@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: Christophe JAILLET [ Upstream commit 086c28ab7c5699256aced0049aae9c42f1410313 ] If an error occurs after calling 'pci_alloc_irq_vectors()', 'pci_free_irq_vectors()' must be called as already done in the remove function. Fixes: 7b7036d47c35 ("intel_th: pci: Use MSI interrupt signalling") Reviewed-by: Andy Shevchenko Signed-off-by: Christophe JAILLET Signed-off-by: Alexander Shishkin Link: https://lore.kernel.org/r/20220705082637.59979-2-alexander.shishkin@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/hwtracing/intel_th/pci.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c index a723c8c33087..3910fafc4fc2 100644 --- a/drivers/hwtracing/intel_th/pci.c +++ b/drivers/hwtracing/intel_th/pci.c @@ -100,8 +100,10 @@ static int intel_th_pci_probe(struct pci_dev *pdev, } th = intel_th_alloc(&pdev->dev, drvdata, resource, r); - if (IS_ERR(th)) - return PTR_ERR(th); + if (IS_ERR(th)) { + err = PTR_ERR(th); + goto err_free_irq; + } th->activate = intel_th_pci_activate; th->deactivate = intel_th_pci_deactivate; @@ -109,6 +111,10 @@ static int intel_th_pci_probe(struct pci_dev *pdev, pci_set_master(pdev); return 0; + +err_free_irq: + pci_free_irq_vectors(pdev); + return err; } static void intel_th_pci_remove(struct pci_dev *pdev) -- 2.35.1