* [PATCH v2] kernfs: fix potential null pointer dereference
@ 2019-07-08 15:16 Peng Wang
2019-07-08 16:37 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Peng Wang @ 2019-07-08 15:16 UTC (permalink / raw)
To: gregkh, tj; +Cc: linux-kernel, Peng Wang
Get root safely after kn is ensureed to be not null.
Signed-off-by: Peng Wang <rocking@whu.edu.cn>
---
fs/kernfs/dir.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index a387534c9577..ddf537923a0a 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -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);
}
/**
--
2.19.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] kernfs: fix potential null pointer dereference
2019-07-08 15:16 [PATCH v2] kernfs: fix potential null pointer dereference Peng Wang
@ 2019-07-08 16:37 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2019-07-08 16:37 UTC (permalink / raw)
To: Peng Wang; +Cc: gregkh, linux-kernel
On Mon, Jul 08, 2019 at 11:16:11PM +0800, Peng Wang wrote:
> 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>
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-08 16:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-08 15:16 [PATCH v2] kernfs: fix potential null pointer dereference Peng Wang
2019-07-08 16:37 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).