Skip to content

Commit 429356f

Browse files
mirimmadmpe
authored andcommitted
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 <[email protected]> Signed-off-by: Immad Mir <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/CY5PR12MB64553EE96EBB3927311DB598C6459@CY5PR12MB6455.namprd12.prod.outlook.com
1 parent 0f71dcf commit 429356f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/powerpc/platforms/powernv/opal-xscom.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn,
168168
ent->path.size = strlen((char *)ent->path.data);
169169

170170
dir = debugfs_create_dir(ent->name, root);
171-
if (!dir) {
171+
if (IS_ERR(dir)) {
172172
kfree(ent->path.data);
173173
kfree(ent);
174174
return -1;
@@ -190,7 +190,7 @@ static int scom_debug_init(void)
190190
return 0;
191191

192192
root = debugfs_create_dir("scom", arch_debugfs_dir);
193-
if (!root)
193+
if (IS_ERR(root))
194194
return -1;
195195

196196
rc = 0;

0 commit comments

Comments
 (0)