Skip to content

Commit a59d629

Browse files
Arend van Sprielgregkh
authored andcommitted
debugfs: change parameter check in debugfs_remove() functions
The dentry parameter in debugfs_remove() and debugfs_remove_recursive() is checked being a NULL pointer. To make cleanup by callers easier this check is extended using the IS_ERR_OR_NULL macro instead because the debugfs_create_... functions can return a ERR_PTR() value. Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0998d06 commit a59d629

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎fs/debugfs/inode.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ void debugfs_remove(struct dentry *dentry)
498498
struct dentry *parent;
499499
int ret;
500500

501-
if (!dentry)
501+
if (IS_ERR_OR_NULL(dentry))
502502
return;
503503

504504
parent = dentry->d_parent;
@@ -530,7 +530,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
530530
struct dentry *child;
531531
struct dentry *parent;
532532

533-
if (!dentry)
533+
if (IS_ERR_OR_NULL(dentry))
534534
return;
535535

536536
parent = dentry->d_parent;

0 commit comments

Comments
 (0)