Commit 429356fa authored by Immad Mir's avatar Immad Mir Committed by Michael Ellerman

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: default avatarIvan Orlov <ivan.orlov0322@gmail.com>
Signed-off-by: default avatarImmad Mir <mirimmad17@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/CY5PR12MB64553EE96EBB3927311DB598C6459@CY5PR12MB6455.namprd12.prod.outlook.com
parent 0f71dcfb
...@@ -168,7 +168,7 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn, ...@@ -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); ent->path.size = strlen((char *)ent->path.data);
dir = debugfs_create_dir(ent->name, root); dir = debugfs_create_dir(ent->name, root);
if (!dir) { if (IS_ERR(dir)) {
kfree(ent->path.data); kfree(ent->path.data);
kfree(ent); kfree(ent);
return -1; return -1;
...@@ -190,7 +190,7 @@ static int scom_debug_init(void) ...@@ -190,7 +190,7 @@ static int scom_debug_init(void)
return 0; return 0;
root = debugfs_create_dir("scom", arch_debugfs_dir); root = debugfs_create_dir("scom", arch_debugfs_dir);
if (!root) if (IS_ERR(root))
return -1; return -1;
rc = 0; rc = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment