Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1013751rdb; Mon, 19 Feb 2024 01:00:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX+F3BWtc+FQy1DgNYU0rLmBkqSN94BeIZwo59+vTOHVMdRRPOh6n0pv3AhhLce/woXLMOcUAhxsmZ5LAb3ZQwujgr239WD3S0KlnB0dg== X-Google-Smtp-Source: AGHT+IEaZ6hvbAf7Zg8yRSW+BxCYYTt+e/HKeVYBdwWntQBp5xPFklDr5Snc+awU3bBU6G1+r0sb X-Received: by 2002:a05:622a:770f:b0:42d:d4bc:3704 with SMTP id ki15-20020a05622a770f00b0042dd4bc3704mr13061213qtb.16.1708333248595; Mon, 19 Feb 2024 01:00:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708333248; cv=pass; d=google.com; s=arc-20160816; b=NbMn+eJheVXpJdAK6Zm8lPAsH96GKA5Z1B6PzqZtSEw+3bDsgoQVyI4tDEJTfm+LF/ vU128d0Zmu+GlLZvRRkN/gBUMnXjoew+IWxotAdKHYswQ5g1lOKMAyLhahjPLJ8+Vy9M 4PV7ELswM7QXEFxuHo2oscap712kgU7DhcRukoYOmMdx3UABxY4ItusbikQkFqgJBxiO mmV45htmGX1XMwGN1YPvtMqHPqdvuhf/7tFyvBLPp32q08HAPv244g797D2jIelfSyC8 rZcmwTAZ3zqlmrTkeMBAKBG+aixmldZdPFR8K1Fc2lzQ8xzGOqnNx/pNNc7UO8eAyA70 dwSQ== 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=cg8RP3M2RWjmyIilN5mObOMONCivGfJr+FowVvUoxQU=; fh=P2qjJwW5Ke3QKpYRHlcwYFdorWj3JMKPIobSmQpscIE=; b=GuUILjJV4V2pbrxUd3jAg+bCUS98+fQaHbJSt+wF7J7KiLEdS3Q2oDYbuBJT5h7oi6 5YPr1Ux98JJ5OLQqX0XRzJrXaYT0nRm3pTUlFep5HD1E0PJ4oIHOzt3SKE1+ffgg6QED eHBrqGJmlhvde++UWFoEVvfvlCvgDwFlQ7W3bF5+YG7H4gkUEK3cUOfep4ns0afA8BYs DdTU/jjYECq9ZezN7A/B8Ft0Nm3WQfsbnbZZE5QpAkzAWxf5ylHeZFAWsBpXGXlKr5Dj lVrRBZIRSAAu3v/MzMqW182yP24skP7YPkDD66GWLnS4whhOeET1BSxetfRte6fWyevx SMOQ==; dara=google.com 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-70981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70981-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j12-20020ac8664c000000b0042c2ed47406si1550958qtp.199.2024.02.19.01.00.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 01:00:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::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-70981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70981-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1342E1C2169A for ; Mon, 19 Feb 2024 09:00:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B50792232E; Mon, 19 Feb 2024 09:00:21 +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 78AF11CD1F for ; Mon, 19 Feb 2024 09:00:17 +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=1708333221; cv=none; b=A0AhmyW4UPn3mh9dLE06CnAj/xXias80MoP7KgX0snuJjRPsEsXZZQAtlUhb2085Y6yH9bdhmBHo16Zt5PlqBLFxAN7uOltn09Pq92+c2K3stGnw12DMHBx6c/RX1bNHJou9W9j0iVjdKaC5auO5+9G/HoAdJZWS+CaSxo6n+Js= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708333221; c=relaxed/simple; bh=4pb1kAmvaqW9Jx4YH42/S+WBGfS58yFpJ3fKaTrKYJ0=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=gz9xYRodlJMVYAZf5Ozt0kn0xsoGO2zWAj2BIkwomo2h8DPn2/jE6R0np/g4kbhLdXX6gTJWSWLp1tHDyrE2PrOt4SUHQ1gJVHVAAI0X55Qg7647B+koXiKXrujre5XwkKGdVSWgjMO96wMRcTmXOLe4kl5Db8GA6jU45FPPflQ= 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.163.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4TdbzG2VsBz2Bcwg; Mon, 19 Feb 2024 16:58:02 +0800 (CST) Received: from dggpemm500006.china.huawei.com (unknown [7.185.36.236]) by mail.maildlp.com (Postfix) with ESMTPS id 62CEB1A0172; Mon, 19 Feb 2024 17:00:09 +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, 19 Feb 2024 17:00:08 +0800 From: =?UTF-8?q?=E9=99=88=E9=AA=8F?= To: , , CC: , Subject: [PATCH v2] irqchip/mbigen: Fix incorrect null pointer check Date: Mon, 19 Feb 2024 16:53:14 +0800 Message-ID: <20240219085314.85363-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) From: Chen Jun bus_get_dev_root returns sp->dev_root set in subsys_register. And subsys_register is not called by platform_bus_init. For platform_bus_type, bus_get_dev_root 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 --- v2: Modify change log v1: https://lore.kernel.org/all/20240129130003.18181-1-chenjun102@huawei.com/ 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