Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1859635rwb; Fri, 19 Aug 2022 10:34:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR7S+9VOa4rYbO0fh4a71gMjqqapTLM17ELT7MeJUcq8CjdjyblKB7yoFI9RQttSZiuBQujW X-Received: by 2002:a63:89c2:0:b0:42a:d95:a821 with SMTP id v185-20020a6389c2000000b0042a0d95a821mr6216294pgd.195.1660930463065; Fri, 19 Aug 2022 10:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930463; cv=none; d=google.com; s=arc-20160816; b=iHTdsyrtQJDCl056csGCohHWX1P9BEn5qEZ9+Xoi2B/YocwKVdyQA+zvTl2icIywfr rOWqgcVpAwwdmCDgsklepn2jB0fu7WNQqiB8AluzFOwdImJW9h95vTqqPswhlwioq9Pl Jb0kIcBHAGwBUTuOTE1cjc/RF1CVl3Scfib1MS9Ol6+6czAMu3RzKs8r4KZqdS4yDtd4 aqL4sR5dTtWILeeCZxnNAkWDU38Gqdn7BcRklHJmdE2WmN/uAu99VMDTc4Y9fb3kV0mr lVg8Jbv3Y7GzCZ/epkDhbwbk1x/3VmJz3u9elah9+0sO2jGoXXd7K4d+3PUNOdxq/FNM 5efA== 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=eWdLwdHTRyV7W2b6iUqWJ4fa3h5ICT8w9DOzj1LvOGo=; b=OZQtRvgrOoZKahtcBbJX3/tOves6K9Bjs2PmA9Gt6l0d9rzpRQxw+y9wu0rnBKMaKZ Qoc9oZWhn+idjzJqqxY97rmBmYim6SgsZxuDMAKIxAQkR0r/peTqyrJQfjQW18Qj2mkB yYdtP24UYmQ9/uLlfzwFGyicM00LUhqWLv2iNMcF1exwRhJrIao6ky2WjBzRm61DQksF YjHn4o4ecMby8Q+k9jsn/ZK9WIrWEfoAoMOSZA1suD/fVhbWGaW1Xg5o5wdvZflEnAKp lk5ta3Gqa3NqzgQ8t7liLHWWv941i45DQ/T+GM9xDJ3qHxnMyvmYTrGC6WtXoBfJittX nh0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qdzY0FRI; 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 k10-20020a63d84a000000b0041a60be4df2si4601484pgj.22.2022.08.19.10.34.12; Fri, 19 Aug 2022 10:34:23 -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=qdzY0FRI; 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 S1352612AbiHSQYE (ORCPT + 99 others); Fri, 19 Aug 2022 12:24:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352273AbiHSQU1 (ORCPT ); Fri, 19 Aug 2022 12:20:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8813F109A38; Fri, 19 Aug 2022 09:01:24 -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 ams.source.kernel.org (Postfix) with ESMTPS id 27A30B8280F; Fri, 19 Aug 2022 16:01:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62639C433D6; Fri, 19 Aug 2022 16:01:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924873; bh=WQmwcwkSAkbHRkR++9IsuWEB1OqnHSvSHLZ3n5R9+nI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qdzY0FRIxDATtznd01d8Gi29CJGgnec2OwsOG5vKR19xZycEPYstvvZxvj1PfY4Mc i1q7f2WgYCFV67jHZpk6rZkibpFZsojlrROxiUE6BbDRbnRLYdXGhUkqQkIAsYI2Ce 0coq/Vj5neGTaOVqIB2INfHkk8bloX7WTQbtJPtY= 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.10 309/545] intel_th: Fix a resource leak in an error handling path Date: Fri, 19 Aug 2022 17:41:19 +0200 Message-Id: <20220819153843.183637595@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 817cdb29bbd8..d032c4de9ce6 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