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>
(cherry picked from commit
f0b54df4d1b58f8f6608e1b08a80a5acb8cc12ea)
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);