summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2026-10-27 17:04:39 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-11-04 14:12:12 +0100
commit847fa880a3e1b2fdbbf72d89e830566108457637 (patch)
tree5b5aa116507f54342caa4eb998c3512c0d3fc146 /scripts
parenta2e52ccce044e13d2695bb1bbdc07942727f28dd (diff)
w1: netlink: drop the slave after the bus is unlocked
w1_process_cb() executes the commands of a netlink message with bus_mutex held, and drops the reference to the slave which the message was addressed to before it unlocks the mutex. If the slave has been detached in the meantime, this is the last reference, and w1_unref_slave() tears the slave down on the spot. That waits - in device_unregister(), for the sysfs callbacks of the slave which are running, and - in w1_therm_remove_slave(), for the readers which have taken a reference to the family data, and both kinds take bus_mutex to talk to the slave. Whoever is waiting for the mutex at that moment is never going to finish, and neither is the thread of the bus master. Unlock the bus first. The reference keeps the slave, and with it the master, alive until then. Fixes: d3a8a9dbb903 ("w1: hold bus_mutex in netlink and search") Cc: stable <stable@kernel.org> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-6-d2e6bfafb6a4@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions