Skip to content

Commit

Permalink
debugfs: change parameter check in debugfs_remove() functions
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Arend van Spriel authored and gregkh committed Jun 13, 2012
1 parent 0998d06 commit a59d629
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/debugfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ void debugfs_remove(struct dentry *dentry)
struct dentry *parent;
int ret;

if (!dentry)
if (IS_ERR_OR_NULL(dentry))
return;

parent = dentry->d_parent;
Expand Down Expand Up @@ -530,7 +530,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
struct dentry *child;
struct dentry *parent;

if (!dentry)
if (IS_ERR_OR_NULL(dentry))
return;

parent = dentry->d_parent;
Expand Down

0 comments on commit a59d629

Please sign in to comment.