Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <xyangxi5@gmail.com>
Link: https://lore.kernel.org/r/20220627120409.11174-1-xyangxi5@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Yangxi Xiang and committed by
Greg Kroah-Hartman
31c779f2 38a523a2

+1
+1
drivers/base/devtmpfs.c
··· 482 482 if (err) { 483 483 printk(KERN_ERR "devtmpfs: unable to create devtmpfs %i\n", err); 484 484 unregister_filesystem(&dev_fs_type); 485 + thread = NULL; 485 486 return err; 486 487 } 487 488