summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/em28xx/em28xx-core.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2013-12-27 13:01:04 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-01-05 08:58:49 -0200
commit54a2a84ea9e8640b4f1df4e222e305d03bb64065 (patch)
tree0267199272444b3ae7d66534dc71c0dfbdb56e87 /drivers/media/usb/em28xx/em28xx-core.c
parentce67943e2dfd3bc8b7e86b428fc0dfc568730971 (diff)
downloadop-kernel-dev-54a2a84ea9e8640b4f1df4e222e305d03bb64065.zip
op-kernel-dev-54a2a84ea9e8640b4f1df4e222e305d03bb64065.tar.gz
[media] em28xx: Fix em28xx deplock
When em28xx extensions are loaded/removed, there are two locks: a single static em28xx_devlist_mutex that registers each extension and the struct em28xx dev->lock. When extensions are registered, em28xx_devlist_mutex is taken first, and then dev->lock. Be sure that, when extensions are being removed, the same order will be used. Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-core.c')
-rw-r--r--drivers/media/usb/em28xx/em28xx-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c
index 3012912d..f773017 100644
--- a/drivers/media/usb/em28xx/em28xx-core.c
+++ b/drivers/media/usb/em28xx/em28xx-core.c
@@ -1094,10 +1094,12 @@ void em28xx_close_extension(struct em28xx *dev)
const struct em28xx_ops *ops = NULL;
mutex_lock(&em28xx_devlist_mutex);
+ mutex_lock(&dev->lock);
list_for_each_entry(ops, &em28xx_extension_devlist, next) {
if (ops->fini)
ops->fini(dev);
}
+ mutex_unlock(&dev->lock);
list_del(&dev->devlist);
mutex_unlock(&em28xx_devlist_mutex);
}
OpenPOWER on IntegriCloud