summaryrefslogtreecommitdiff
path: root/fs/sysfs/file.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-01-11 18:23:23 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-11 15:40:19 -0800
commit88533f990c616cf50c2fe585ea03f75c806a293d (patch)
treee617079daee5aca361f4f531102bd7866a755125 /fs/sysfs/file.c
parent2a41e6070dd7ef539d0f3b1652b4839d04378e11 (diff)
kernfs: remove unnecessary NULL check in __kernfs_remove()
895a068a524e ("kernfs: make kernfs_get_active() block if the node is deactivated but not removed") added "struct kernfs_root *root = kernfs_root(kn);" at the head of the function; however, the parameter @kn is checked for later implying that the function may be called with NULL. This means that we may end up invoking kernfs_root() with NULL which will oops. None of the existing users invokes removal with NULL @kn, so this bug doesn't actually trigger. We can relocate kernfs_root() invocation after NULL check; however, allowing NULL param tends to cause more confusion than actually helping anything. As there's no existing user, let's remove the spurious NULL check. This bug was detected by smatch. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysfs/file.c')
0 files changed, 0 insertions, 0 deletions