]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
staging: vchiq_arm: Fix possible NPR of keep-alive thread
authorStefan Wahren <wahrenst@gmx.net>
Sun, 9 Mar 2025 12:50:11 +0000 (13:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:26 +0000 (14:39 +0200)
commit1817c4b85011998604e5ff9a80a6e01adb7e7e81
tree9b2ee3e8f7907d7165f56c0a68fd54bb1d5ca82a
parentf3fafa188d96e7cd1c155ec717f908e7361872e0
staging: vchiq_arm: Fix possible NPR of keep-alive thread

[ Upstream commit 3db89bc6d973e2bcaa852f6409c98c228f39a926 ]

In case vchiq_platform_conn_state_changed() is never called or fails before
driver removal, ka_thread won't be a valid pointer to a task_struct. So
do the necessary checks before calling kthread_stop to avoid a crash.

Fixes: 863a756aaf49 ("staging: vc04_services: vchiq_core: Stop kthreads on vchiq module unload")
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Link: https://lore.kernel.org/r/20250309125014.37166-3-wahrenst@gmx.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c