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>
This commit is contained in:
Arend van Spriel 2012-05-23 15:13:07 +02:00 committed by Greg Kroah-Hartman
parent 0998d06310
commit a59d6293e5
1 changed files with 2 additions and 2 deletions

View File

@ -498,7 +498,7 @@ void debugfs_remove(struct dentry *dentry)
struct dentry *parent; struct dentry *parent;
int ret; int ret;
if (!dentry) if (IS_ERR_OR_NULL(dentry))
return; return;
parent = dentry->d_parent; parent = dentry->d_parent;
@ -530,7 +530,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
struct dentry *child; struct dentry *child;
struct dentry *parent; struct dentry *parent;
if (!dentry) if (IS_ERR_OR_NULL(dentry))
return; return;
parent = dentry->d_parent; parent = dentry->d_parent;