aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/devtmpfs.c
diff options
context:
space:
mode:
authorYangxi Xiang <[email protected]>2022-06-27 12:04:09 +0000
committerGreg Kroah-Hartman <[email protected]>2022-06-27 14:41:13 +0000
commit31c779f293b343577690c01369a5019ca6ec5de9 (patch)
tree8943dfbf2c100f2237e9915dd7baef0e4e88b8c4 /drivers/base/devtmpfs.c
parentRevert "devcoredump: remove the useless gfp_t parameter in dev_coredumpv and ... (diff)
downloadkernel-31c779f293b343577690c01369a5019ca6ec5de9.tar.gz
kernel-31c779f293b343577690c01369a5019ca6ec5de9.zip
devtmpfs: fix the dangling pointer of global devtmpfsd thread
When the devtmpfs fails to mount, a dangling pointer still remains in global. Specifically, the err variable is passed by a pointer to the devtmpfsd. When the devtmpfsd exits, it sets the error and completes the setup_done. In this situation, the thread pointer is not set to null. After the devtmpfsd exited, the devtmpfs can wakes up the destroyed devtmpfsd thread by wake_up_process if a device change event comes. Signed-off-by: Yangxi Xiang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/base/devtmpfs.c')
-rw-r--r--drivers/base/devtmpfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
index 8a3ddbae3b70..e4bffeabf344 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -482,6 +482,7 @@ int __init devtmpfs_init(void)
if (err) {
printk(KERN_ERR "devtmpfs: unable to create devtmpfs %i\n", err);
unregister_filesystem(&dev_fs_type);
+ thread = NULL;
return err;
}