mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Peng Wang <rocking@whu.edu.cn>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernfs: fix potential null pointer dereference
Date: Mon, 8 Jul 2019 07:37:48 -0700	[thread overview]
Message-ID: <20190708143748.GZ657710@devbig004.ftw2.facebook.com> (raw)
In-Reply-To: <20190705134730.20833-1-rocking@whu.edu.cn>

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

      reply	other threads:[~2019-07-08 14:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05 13:47 Peng Wang
2019-07-08 14:37 ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190708143748.GZ657710@devbig004.ftw2.facebook.com \
    --to=tj@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rocking@whu.edu.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome