From nobody Mon May 6 12:36:26 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 1668409865236943.4486941001983; Sun, 13 Nov 2022 23:11:05 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.443134.697589 (Exim 4.92) (envelope-from ) id 1ouTbx-0001Bi-Jb; Mon, 14 Nov 2022 07:10:29 +0000 Received: by outflank-mailman (output) from mailman id 443134.697589; Mon, 14 Nov 2022 07:10:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ouTbx-0001Bb-Gx; Mon, 14 Nov 2022 07:10:29 +0000 Received: by outflank-mailman (input) for mailman id 443134; Mon, 14 Nov 2022 07:10:29 +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 1ouTbx-0001BV-1K for xen-devel@lists.xenproject.org; Mon, 14 Nov 2022 07:10:29 +0000 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 684a74c2-63eb-11ed-91b6-6bf2151ebd3b; Mon, 14 Nov 2022 08:10:26 +0100 (CET) Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4N9gRl72F2zmVpJ; Mon, 14 Nov 2022 15:09:55 +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 15:10:15 +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: 684a74c2-63eb-11ed-91b6-6bf2151ebd3b From: ruanjinjie To: , , , , CC: Subject: [PATCH] xen: add missing free_irq() in error path Date: Mon, 14 Nov 2022 15:07:02 +0800 Message-ID: <20221114070702.1887144-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: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected X-ZM-MESSAGEID: 1668409866370100001 Content-Type: text/plain; charset="utf-8" free_irq() is missing in case of error, fix that. Signed-off-by: ruanjinjie Reviewed-by: Oleksandr Tyshchenko --- 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