diff options
author | Immad Mir <mirimmad17@gmail.com> | 2023-05-28 13:16:44 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-08-23 15:55:17 +1000 |
commit | 429356fac0440b962aaa6d3688709813a21dd122 (patch) | |
tree | 1b28c59bd5f56bbcf47d2c4844f6d5f86fea802d /arch/powerpc/platforms | |
parent | 0f71dcfb4aef6043da6cc509e7a7f6a3ae87c12d (diff) | |
download | lwn-429356fac0440b962aaa6d3688709813a21dd122.tar.gz lwn-429356fac0440b962aaa6d3688709813a21dd122.zip |
powerpc/powernv: fix debugfs_create_dir() error checking
The debugfs_create_dir returns ERR_PTR incase of an error and the
correct way of checking it by using the IS_ERR inline function, and
not the simple null comparision. This patch fixes this.
Suggested-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Signed-off-by: Immad Mir <mirimmad17@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/CY5PR12MB64553EE96EBB3927311DB598C6459@CY5PR12MB6455.namprd12.prod.outlook.com
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-xscom.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-xscom.c b/arch/powerpc/platforms/powernv/opal-xscom.c index 6b4eed2ef4fa..262cd6fac907 100644 --- a/arch/powerpc/platforms/powernv/opal-xscom.c +++ b/arch/powerpc/platforms/powernv/opal-xscom.c @@ -168,7 +168,7 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn, ent->path.size = strlen((char *)ent->path.data); dir = debugfs_create_dir(ent->name, root); - if (!dir) { + if (IS_ERR(dir)) { kfree(ent->path.data); kfree(ent); return -1; @@ -190,7 +190,7 @@ static int scom_debug_init(void) return 0; root = debugfs_create_dir("scom", arch_debugfs_dir); - if (!root) + if (IS_ERR(root)) return -1; rc = 0; |