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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4D1E7C433FE for ; Wed, 23 Nov 2022 12:45:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.447560.703950 (Exim 4.92) (envelope-from ) id 1oxp7n-0007wd-Tp; Wed, 23 Nov 2022 12:45:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 447560.703950; Wed, 23 Nov 2022 12:45:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oxp7n-0007wU-QS; Wed, 23 Nov 2022 12:45:11 +0000 Received: by outflank-mailman (input) for mailman id 447560; Wed, 23 Nov 2022 12:45:10 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oxp7m-0007vg-8c for xen-devel@lists.xenproject.org; Wed, 23 Nov 2022 12:45:10 +0000 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a9d53953-6b2c-11ed-8fd2-01056ac49cbb; Wed, 23 Nov 2022 13:45:09 +0100 (CET) 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 B524DB81F6F; Wed, 23 Nov 2022 12:45:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84134C4347C; Wed, 23 Nov 2022 12:45:06 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a9d53953-6b2c-11ed-8fd2-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669207507; bh=3Z5VSz+IaXP3WVAY6Thqe7EqruPoNaXQOHKek17Oe7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MJnEFhUaa2fDFamkRLo7D9SoZMoSsCt8bhr6XENmv2mUjoTRzXvVCd9x+ysvXLW1O St0zu5yeQl7DYUzadV/QT+j7hXfSIjJMHOjOPIsLXEa8nqXmoXW3WLEFzS1jsXMoQ3 7/QQB1Kdb6m6+QMaT2OZJ4fbM4y0tyq0Z2Mycfj9Gd0UmEABwbQns6bIpkWsLJ+aHm 4QTPsIlOsrx2fRMZQyWN9DYulz3rYAskOeJ7r9EVB1uhyjiz9XFneKPDeWIvEyqasA ceoqze8NPQKkJ1UbeBO74O/DTOL6lfAB2BptHrt0mbs4UjfD6vbPvS+Q4Fh6eVvXxE ZlggVldtPs+Tw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: ruanjinjie , Oleksandr Tyshchenko , Juergen Gross , Sasha Levin , sstabellini@kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH AUTOSEL 4.19 03/11] xen/platform-pci: add missing free_irq() in error path Date: Wed, 23 Nov 2022 07:44:48 -0500 Message-Id: <20221123124458.266492-3-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221123124458.266492-1-sashal@kernel.org> References: <20221123124458.266492-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: ruanjinjie [ Upstream commit c53717e1e3f0d0f9129b2e0dbc6dcc5e0a8132e9 ] free_irq() is missing in case of error in platform_pci_probe(), fix that. Signed-off-by: ruanjinjie Reviewed-by: Oleksandr Tyshchenko Link: https://lore.kernel.org/r/20221114112124.1965611-1-ruanjinjie@huawei.com Signed-off-by: Juergen Gross Signed-off-by: Sasha Levin --- drivers/xen/platform-pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c index 4cec8146609a..c7e190e5db30 100644 --- a/drivers/xen/platform-pci.c +++ b/drivers/xen/platform-pci.c @@ -150,7 +150,7 @@ static int platform_pci_probe(struct pci_dev *pdev, if (ret) { dev_warn(&pdev->dev, "Unable to set the evtchn callback " "err=%d\n", ret); - goto out; + goto irq_out; } } @@ -158,13 +158,16 @@ static int platform_pci_probe(struct pci_dev *pdev, grant_frames = alloc_xen_mmio(PAGE_SIZE * max_nr_gframes); ret = gnttab_setup_auto_xlat_frames(grant_frames); if (ret) - goto out; + goto irq_out; ret = gnttab_init(); if (ret) goto grant_out; return 0; grant_out: gnttab_free_auto_xlat_frames(); +irq_out: + if (!xen_have_vector_callback) + free_irq(pdev->irq, pdev); out: pci_release_region(pdev, 0); mem_out: -- 2.35.1