From patchwork Mon Nov 14 11:21:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 19720 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2091765wru; Mon, 14 Nov 2022 03:30:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ovo0U/vyuPW0IPrrM8sAJioWf4YFaFOEftdruxjt5H2HmM+gM0KU1BAzXtAlczh3qEQ29 X-Received: by 2002:a17:902:ce8b:b0:17e:20ec:545a with SMTP id f11-20020a170902ce8b00b0017e20ec545amr13480483plg.112.1668425445168; Mon, 14 Nov 2022 03:30:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668425445; cv=none; d=google.com; s=arc-20160816; b=SO5PjX5Qk5tpwxxJGO22QpVa1OPWie9HDwtn7MW5oKSgjQHsUsEWcmVy0pTSZp0iAs KcwEZuqV6LsaVONjNXWxnFOMfSO+u6Ff6N99wcIVyKzRFpVSgK5ALYHt8Xp9nSYue9e2 WaH8vpKjoa2b6pyuDnlDHrU52FEChToeWP/wTiHOwn2e0IsLuyMJIhMfVFr1XTKZoTme vUL56G8eMgAfebyTs/hhQztAuLMR5GciOYjlfoWklmiQVn8cu5dh+osaFobZ2aUjdhsW UVjMDC+RplejAGYxX6mhP0nMHYCtR8VRZRFtXaoH7z2fbv0hviqXtV8gz1jK98xQxAjO /KAQ== 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 :message-id:date:subject:cc:to:from; bh=YkXDaXtkUdQM1/YV+NhNsxiSyrRiYh2FG1Rio72Is7Y=; b=IxcnalBKf/nG1++ErEOVIQ5OplN8Ufk41dzkCiwssXy5wFMtEUzZE9SN1hS0qnhQr+ mnJe0jue0hREz0Yvngq4wvr4dRam5+a0Rs6Rh+/AdUJVXDltIiGHogz2Pft/Gghtm7v5 ww6hXDjqrzPQWVaf+tWbb5ExEvd2y21iGCK0uzcH+1acM9dfygitZinEH+XYe0wyzBFD jiF0YCSv6AO82beEQdfkSeGbkzknEYAvbHFYmBZbd8dTm11JtF04Ei2/TRzLPYCwcCaD pyzswZvMhd+Fy4sD7yYpWQ6y9d/8fXf4XszuBUQ9w7cUnohoTF148RKy8hFf1Jvv3ohu BGHw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g127-20020a636b85000000b00474b84509e1si7658071pgc.352.2022.11.14.03.30.31; Mon, 14 Nov 2022 03:30:45 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235979AbiKNL1Q (ORCPT + 99 others); Mon, 14 Nov 2022 06:27:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236175AbiKNL01 (ORCPT ); Mon, 14 Nov 2022 06:26:27 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 819381FCD2 for ; Mon, 14 Nov 2022 03:24:39 -0800 (PST) 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 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 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749470879576624088?= X-GMAIL-MSGID: =?utf-8?q?1749470879576624088?= 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=%d\n", ret); - goto out; + goto irq_out; } } @@ -152,13 +152,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: