]> git.baikalelectronics.ru Git - kernel.git/commit
devtmpfs: fix the dangling pointer of global devtmpfsd thread
authorYangxi Xiang <xyangxi5@gmail.com>
Mon, 27 Jun 2022 12:04:09 +0000 (20:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2022 14:41:13 +0000 (16:41 +0200)
commitac1747e55648a6b30bc7698c4f5b9ed10b19201c
tree8943dfbf2c100f2237e9915dd7baef0e4e88b8c4
parentc20f3e48888bf411db8e791d5b4d4ae31d25c9b6
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>
drivers/base/devtmpfs.c