projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
515db26
)
kernfs: fix potential null pointer dereference
author
Peng Wang
<rocking@whu.edu.cn>
Mon, 8 Jul 2019 15:16:11 +0000
(23:16 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 25 Jul 2019 13:30:48 +0000
(15:30 +0200)
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>
fs/kernfs/dir.c
patch
|
blob
|
history
diff --git
a/fs/kernfs/dir.c
b/fs/kernfs/dir.c
index
a387534
..
ddf5379
100644
(file)
--- 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);
}
/**