1
0
Fork 0

kernfs: fix potential null pointer dereference

Get root safely after kn is ensureed to be not null.

Signed-off-by: Peng Wang <rocking@whu.edu.cn>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20190708151611.13242-1-rocking@whu.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
alistair/sunxi64-5.4-dsi
Peng Wang 2019-07-08 23:16:11 +08:00 committed by Greg Kroah-Hartman
parent 515db266a9
commit 2fd60da46d
1 changed files with 1 additions and 2 deletions

View File

@ -430,7 +430,6 @@ struct kernfs_node *kernfs_get_active(struct kernfs_node *kn)
*/
void kernfs_put_active(struct kernfs_node *kn)
{
struct kernfs_root *root = kernfs_root(kn);
int v;
if (unlikely(!kn))
@ -442,7 +441,7 @@ void kernfs_put_active(struct kernfs_node *kn)
if (likely(v != KN_DEACTIVATED_BIAS))
return;
wake_up_all(&root->deactivate_waitq);
wake_up_all(&kernfs_root(kn)->deactivate_waitq);
}
/**