[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240821112131.6004-1-11162571@vivo.com>
Date: Wed, 21 Aug 2024 07:21:30 -0400
From: Yang Ruibin <11162571@...o.com>
To: Andrew Lunn <andrew@...n.ch>,
Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
Gregory Clement <gregory.clement@...tlin.com>,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com,
Yang Ruibin <11162571@...o.com>
Subject: [PATCH v1] drivers:bus:Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
The debugfs_create_dir() function returns error pointers.
It never returns NULL. So use IS_ERR() to check it.
Signed-off-by: Yang Ruibin <11162571@...o.com>
---
drivers/bus/mvebu-mbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index 3c99d72087eb..42621838ba75 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -995,13 +995,13 @@ static __init int mvebu_mbus_debugfs_init(void)
s->debugfs_root = debugfs_create_dir("mvebu-mbus", NULL);
if(IS_ERR(s->debugfs_root))
return PTR_ERR(s->debugfs_root);
+
s->debugfs_sdram = debugfs_create_file("sdram", S_IRUGO,
s->debugfs_root, NULL,
&mvebu_sdram_debug_fops);
s->debugfs_devs = debugfs_create_file("devices", S_IRUGO,
s->debugfs_root, NULL,
&mvebu_devs_debug_fops);
- }
return 0;
}
--
2.34.1
Powered by blists - more mailing lists