]> git.baikalelectronics.ru Git - kernel.git/commit
pcmcia: fix setting of kthread task states
authorDominik Brodowski <linux@dominikbrodowski.net>
Sun, 9 Jan 2022 09:02:51 +0000 (10:02 +0100)
committerDominik Brodowski <linux@dominikbrodowski.net>
Sun, 9 Jan 2022 20:30:04 +0000 (21:30 +0100)
commit928950f1463b8b41eee24fc4e909ee90e17adbaf
treefae441b936ab4b1a7bffe1786540e2d80463c279
parenta29fb0b1b6ca11b884957cd74a846094ba08e7c4
pcmcia: fix setting of kthread task states

We need to set TASK_INTERRUPTIBLE before calling kthread_should_stop().
Otherwise, kthread_stop() might see that the pccardd thread is still
in TASK_RUNNING state and fail to wake it up.

Additionally, we only need to set the state back to TASK_RUNNING if
kthread_should_stop() breaks the loop.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Fixes: f0b68c88da35 ("pcmcia: fix a boot time warning in pcmcia cs code")
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
drivers/pcmcia/cs.c