Commit 0ec83ba4 authored by Saravana Kannan's avatar Saravana Kannan Committed by Yang Yingliang
Browse files

driver core: Fix locking bug in deferred_probe_timeout_work_func()



stable inclusion
from linux-4.19.188
commit f59a6ec295a5e7cc75feefbd7903243322de338f

--------------------------------

commit eed6e418 upstream.

list_for_each_entry_safe() is only useful if we are deleting nodes in a
linked list within the loop. It doesn't protect against other threads
adding/deleting nodes to the list in parallel. We need to grab
deferred_probe_mutex when traversing the deferred_probe_pending_list.

Cc: stable@vger.kernel.org
Fixes: 25b4e70d ("driver core: allow stopping deferred probe after init")
Signed-off-by: default avatarSaravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20210402040342.2944858-2-saravanak@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent af6b896e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment