From nobody Fri Mar 29 11:09:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=quarantine dis=quarantine) header.from=huawei.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1668425112180904.5956594399242; Mon, 14 Nov 2022 03:25:12 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.443280.697832 (Exim 4.92) (envelope-from ) id 1ouXa1-0003ma-K8; Mon, 14 Nov 2022 11:24:45 +0000 Received: by outflank-mailman (output) from mailman id 443280.697832; Mon, 14 Nov 2022 11:24:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ouXa1-0003mT-HU; Mon, 14 Nov 2022 11:24:45 +0000 Received: by outflank-mailman (input) for mailman id 443280; Mon, 14 Nov 2022 11:24:44 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ouXZz-0003mN-V5 for xen-devel@lists.xenproject.org; Mon, 14 Nov 2022 11:24:43 +0000 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ed457ba5-640e-11ed-91b6-6bf2151ebd3b; Mon, 14 Nov 2022 12:24:41 +0100 (CET) Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4N9n224lmfzJnhv; Mon, 14 Nov 2022 19:21:30 +0800 (CST) Received: from huawei.com (10.67.175.83) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 14 Nov 2022 19:24:36 +0800 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: ed457ba5-640e-11ed-91b6-6bf2151ebd3b From: ruanjinjie To: , , , , CC: Subject: [PATCH v2] xen/platform-pci: add missing free_irq() in error path Date: Mon, 14 Nov 2022 19:21:24 +0800 Message-ID: <20221114112124.1965611-1-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.67.175.83] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected X-ZM-MESSAGEID: 1668425114194100001 Content-Type: text/plain; charset="utf-8" free_irq() is missing in case of error in platform_pci_probe(), fix that. Signed-off-by: ruanjinjie Reviewed-by: Oleksandr Tyshchenko --- v2: - improve the subject to describe which subsystem it targets. --- 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 18f0ed8b1f93..6ebd819338ec 100644 --- a/drivers/xen/platform-pci.c +++ b/drivers/xen/platform-pci.c @@ -144,7 +144,7 @@ static int platform_pci_probe(struct pci_dev *pdev, if (ret) { dev_warn(&pdev->dev, "Unable to set the evtchn callback " "err=3D%d\n", ret); - goto out; + goto irq_out; } } =20 @@ -152,13 +152,16 @@ static int platform_pci_probe(struct pci_dev *pdev, grant_frames =3D alloc_xen_mmio(PAGE_SIZE * max_nr_gframes); ret =3D gnttab_setup_auto_xlat_frames(grant_frames); if (ret) - goto out; + goto irq_out; ret =3D 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: --=20 2.25.1