Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Arend van Spriel and committed by
Greg Kroah-Hartman
a59d6293 0998d063

+2 -2
+2 -2
fs/debugfs/inode.c
··· 498 498 struct dentry *parent; 499 499 int ret; 500 500 501 - if (!dentry) 501 + if (IS_ERR_OR_NULL(dentry)) 502 502 return; 503 503 504 504 parent = dentry->d_parent; ··· 530 530 struct dentry *child; 531 531 struct dentry *parent; 532 532 533 - if (!dentry) 533 + if (IS_ERR_OR_NULL(dentry)) 534 534 return; 535 535 536 536 parent = dentry->d_parent;