Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp375285rdb; Mon, 29 Jan 2024 05:11:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGtaBEpyK9irYC6CSqiiCJjE0e33S4kHJyg1/AtVitwkRoXPG/vxjh9ZTrFmw35d5d1/iL X-Received: by 2002:a17:902:7482:b0:1d7:7764:36a4 with SMTP id h2-20020a170902748200b001d7776436a4mr2670249pll.36.1706533904848; Mon, 29 Jan 2024 05:11:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706533904; cv=pass; d=google.com; s=arc-20160816; b=hDl484X21b1qs5vkhD9bGWjurqzaE4NIRpkkDU0QyVEXL20HhwE21uxEtKcHHoVUO8 SNa/JyLf3LMpRCb8rOX/qyz9hIG+AI/rYRk0esfHUdxKqRUOvyGwImGDVcLYObDQ/RBf nFx8zpNBJ0UpWJ6wIBiuJtHtXF8EYgB1LJQu8ycoxD61+rLdB32IoAZG3PkYP+6gqCQ5 qmHyzoETJuS4S1sGMWmZYsA6wDoA8qP1eJtmLuYPK0qBxIbdKc7COI4YsTuocoQdslJI K2I1wjqp8IGFg9GDihAGcGt9cCms4RH0VABSjx7lkkGcyhQw+Eu6AGCkMRxEWnv/F7It JbNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from; bh=2CLFo3mZWwaopgo7C1MWK94RZw5NBm5fuwZu4mvaGuw=; fh=PxG4zb+kjwo33c1uySFM8rbIUUQUXMKERUyK8OIQerU=; b=jbv5MihbGzL+zGxqaL1pzcnlL0l2+cDTw57WAfn5SX4XvZg48XnYvJDqiNNT7nXa1l VhaVsMtXzkcak8rdrb5hEy6NT4RgCj5+4Jv7Rd9aANQjJ/k8dsguoTpVgkDMhsEPO1p/ Bv3bzrGL2+uj20skxk3HsF9c821qeAJrh+RgElGZbA9CYkqEFOD9IUUu4qM4E/+Lu4sS 98HpbOjXje7jZ3hjRKbUp0LVUNgBKi72pvOL/DB/LFxVcryGyM48HmLtbp8fpVv84lmH GmiII7+zeXI8FZxy/I91XZVhAuJ4CQZpG84V+pxFXU0q79CD9IJXm8ZumadbH5EvK9zN Y9bA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-42755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42755-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id az10-20020a170902a58a00b001d7313028e5si5588147plb.430.2024.01.29.05.11.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 05:11:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-42755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42755-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E630C28864D for ; Mon, 29 Jan 2024 13:08:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35B79664AD; Mon, 29 Jan 2024 13:06:26 +0000 (UTC) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E1C465BD8 for ; Mon, 29 Jan 2024 13:06:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706533585; cv=none; b=AIIls3uPIQ0Po4fwNAT+UA7DrrTL93tPR4hJvvzWhsBtuc/Ska3jvJU2mrMrgouI93nIK9nHp0YA9OmYkwU7TFVzFSWOQmh73WFlaTmUNOSovg+jCIUa0KxAiUNDDzDzt+tiG6owNiIOvowJSipS9Ig2Tifa9+dRRKh2W3wJA2M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706533585; c=relaxed/simple; bh=VZrE8f8zCIOoTX/qV216j37du50vp/T05X9GLljT+Mo=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=hi9j89Kh4yk/ZU5AuImFy3Gq7sXD0sbOxPYMgzzS99yUMHV4H786VHnjdNxKDnVLjQ+4PxUqE18NxorCc3l7TRYXMR96Nb36JB+gmVEt/QsekBDEXdHNkV/3ghGxCVRCqPUn7euDaDMLJTZ/vdnXnrwbfDtqpj+Yioisw8tZy2U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4TNpRJ4QW8z29kmm for ; Mon, 29 Jan 2024 21:04:28 +0800 (CST) Received: from dggpemm500006.china.huawei.com (unknown [7.185.36.236]) by mail.maildlp.com (Postfix) with ESMTPS id 657951404DB for ; Mon, 29 Jan 2024 21:06:17 +0800 (CST) Received: from mdc.huawei.com (10.175.112.208) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 29 Jan 2024 21:06:16 +0800 From: Chen Jun To: , CC: , Subject: [PATCH] irqchip/mbigen: Fix incorrect null pointer check Date: Mon, 29 Jan 2024 21:00:03 +0800 Message-ID: <20240129130003.18181-1-chenjun102@huawei.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500006.china.huawei.com (7.185.36.236) bus_get_dev_root(&platform_bus_type) always returns NULL. This makes mbigen_of_create_domain always return -ENODEV. Fixes: fea087fc291b ("irqchip/mbigen: move to use bus_get_dev_root()") Signed-off-by: Chen Jun --- drivers/irqchip/irq-mbigen.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c index 5101a3fb11df..58881d313979 100644 --- a/drivers/irqchip/irq-mbigen.c +++ b/drivers/irqchip/irq-mbigen.c @@ -235,22 +235,17 @@ static const struct irq_domain_ops mbigen_domain_ops = { static int mbigen_of_create_domain(struct platform_device *pdev, struct mbigen_device *mgn_chip) { - struct device *parent; struct platform_device *child; struct irq_domain *domain; struct device_node *np; u32 num_pins; int ret = 0; - parent = bus_get_dev_root(&platform_bus_type); - if (!parent) - return -ENODEV; - for_each_child_of_node(pdev->dev.of_node, np) { if (!of_property_read_bool(np, "interrupt-controller")) continue; - child = of_platform_device_create(np, NULL, parent); + child = of_platform_device_create(np, NULL, NULL); if (!child) { ret = -ENOMEM; break; @@ -273,7 +268,6 @@ static int mbigen_of_create_domain(struct platform_device *pdev, } } - put_device(parent); if (ret) of_node_put(np); -- 2.17.1