summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSandor Yu <R01008@freescale.com>2015-05-29 17:07:04 +0800
committerSandor Yu <R01008@freescale.com>2015-06-05 17:34:34 +0800
commita4f33b0df1b0255c53e01aae9c00ab654fc273ef (patch)
tree2a975d8a2cf4f9e6f72c692e1f26989fe0131d5a /drivers
parent9572726009dfb9a485ab85a17dfa2993e9d2f4b3 (diff)
MLK-10256-02 v4l2: Add v4l2_async_notifier_unregister recursively call
If anyone calls v4l2_async_notifier_unregister() recursively from device_release_driver(), code will deadlock at list_lock, so unlock list_lock when device_release_driver() called. Signed-off-by: Sandor Yu <R01008@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/v4l2-core/v4l2-async.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index 85a6a34128a8..a0dc460c9147 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -213,7 +213,14 @@ void v4l2_async_notifier_unregister(struct v4l2_async_notifier *notifier)
v4l2_async_cleanup(sd);
/* If we handled USB devices, we'd have to lock the parent too */
+ /*
+ * If anyone calls v4l2_async_notifier_unregister() recursively from
+ * device_release_driver(), code will deadlock at list_lock,
+ * so unlock list_lock when device_release_driver() called.
+ */
+ mutex_unlock(&list_lock);
device_release_driver(d);
+ mutex_lock(&list_lock);
if (notifier->unbind)
notifier->unbind(notifier, sd, sd->asd);