aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/trigger/stm32-timer-trigger.c
diff options
context:
space:
mode:
authorJuergen Gross <[email protected]>2017-07-28 14:53:55 +0000
committerJuergen Gross <[email protected]>2017-08-11 14:45:56 +0000
commit529871bb3c0675d0b425e2070d5a739db097be98 (patch)
tree0422815a0e9fe13f44bebde0046b768569ea36e9 /drivers/iio/trigger/stm32-timer-trigger.c
parentxen: fix hvm guest with kaslr enabled (diff)
downloadkernel-529871bb3c0675d0b425e2070d5a739db097be98.tar.gz
kernel-529871bb3c0675d0b425e2070d5a739db097be98.zip
xen: avoid deadlock in xenbus
When starting the xenwatch thread a theoretical deadlock situation is possible: xs_init() contains: task = kthread_run(xenwatch_thread, NULL, "xenwatch"); if (IS_ERR(task)) return PTR_ERR(task); xenwatch_pid = task->pid; And xenwatch_thread() does: mutex_lock(&xenwatch_mutex); ... event->handle->callback(); ... mutex_unlock(&xenwatch_mutex); The callback could call unregister_xenbus_watch() which does: ... if (current->pid != xenwatch_pid) mutex_lock(&xenwatch_mutex); ... In case a watch is firing before xenwatch_pid could be set and the callback of that watch unregisters a watch, then a self-deadlock would occur. Avoid this by setting xenwatch_pid in xenwatch_thread(). Signed-off-by: Juergen Gross <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
Diffstat (limited to 'drivers/iio/trigger/stm32-timer-trigger.c')
0 files changed, 0 insertions, 0 deletions