lkml.org 
[lkml]   [2019]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kernfs: fix potential null pointer dereference
On Fri, Jul 05, 2019 at 09:47:30PM +0800, Peng Wang wrote:
> diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
> index a387534c9577..ea3fc972c48b 100644
> --- a/fs/kernfs/dir.c
> +++ b/fs/kernfs/dir.c
> @@ -430,7 +430,7 @@ 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);
> + struct kernfs_root *root;
> int v;
>
> if (unlikely(!kn))
> @@ -442,6 +442,7 @@ void kernfs_put_active(struct kernfs_node *kn)
> if (likely(v != KN_DEACTIVATED_BIAS))
> return;
>
> + root = kernfs_root(kn);
> wake_up_all(&root->deactivate_waitq);

Maybe just remove the root variable altogether? Other than that,

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

--
tejun

\
 
 \ /
  Last update: 2019-07-08 16:38    [W:0.042 / U:0.876 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site