diff options
author | Arend van Spriel <arend@broadcom.com> | 2012-05-23 15:13:07 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-14 01:40:41 +0200 |
commit | a59d6293e5372d7c35212932e083e2a541151eff (patch) | |
tree | a10dd1c0874517e8cbc3dc0d4300920d42fbeca5 /fs/debugfs | |
parent | device-core: Ensure drvdata = NULL when no driver is bound (diff) | |
download | linux-a59d6293e5372d7c35212932e083e2a541151eff.tar.xz linux-a59d6293e5372d7c35212932e083e2a541151eff.zip |
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>
Diffstat (limited to 'fs/debugfs')
-rw-r--r-- | fs/debugfs/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index b80bc846a15a..0de5e26870c3 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -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; @@ -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; |