From mboxrd@z Thu Jan 1 00:00:00 1970 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 EF50EC433FE for ; Wed, 23 Nov 2022 12:56:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238677AbiKWM4L (ORCPT ); Wed, 23 Nov 2022 07:56:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238520AbiKWMzV (ORCPT ); Wed, 23 Nov 2022 07:55:21 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1184B6B38F; Wed, 23 Nov 2022 04:45:31 -0800 (PST) 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 7C63BB81F70; Wed, 23 Nov 2022 12:45:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 694C2C433D7; Wed, 23 Nov 2022 12:45:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669207528; bh=3Z5VSz+IaXP3WVAY6Thqe7EqruPoNaXQOHKek17Oe7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sFQ5yoeNiVW/jqkdfMwNI1vYzLy+rzhvWe4Jmb9spLL5CKewzJn3r3jv/OZL0gYnM nYHt7AlpTS2PTLEFqnq/T/3hbnn9x2COxFDhfVjukA54TImSA54zSK+bHK+Snu++zV ablbXXZRWMt4d6BCkNdVNQofl7/xaYvoBMITw9qRu4hOIx33PHCMMhXm78G+8cqQAI Z0BjC+ZJsdApmS/P/HcRnrDkjZ4qfngzcCTz6wUOvImPYKCwThqiwtlYSdCWTKgkyX laUE3HFJCzD5a0cJ/14UNmT7JgJm7QwqY9jj0j1lHlFjfOMnmS8RffpRoNawGI+rKl 7TP/tJf34IOgA== 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.14 03/10] xen/platform-pci: add missing free_irq() in error path Date: Wed, 23 Nov 2022 07:45:11 -0500 Message-Id: <20221123124520.266643-3-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221123124520.266643-1-sashal@kernel.org> References: <20221123124520.266643-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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