aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2012-03-16 18:14:51 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-03-19 21:15:29 -0400
commit0770d07f7b33081f68f8d7a291395005d7044c6b (patch)
treebdecbe964775ba9341ea5dba9bc11347ac09ea18 /drivers/media/video
parent49df19ebcc60fd46f2587774cd6e224007af1116 (diff)
[media] marvell-cam: Remove broken "owner" logic
The marvell cam driver retained just enough of the owner-tracking logic from cafe_ccic to be broken; it could, conceivably, cause the driver to release DMA memory while the controller is still active. Simply remove the remaining pieces and ensure that the controller is stopped before we free things. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/marvell-ccic/mcam-core.c5
-rw-r--r--drivers/media/video/marvell-ccic/mcam-core.h1
2 files changed, 1 insertions, 5 deletions
diff --git a/drivers/media/video/marvell-ccic/mcam-core.c b/drivers/media/video/marvell-ccic/mcam-core.c
index 35cd89d3e67..b2611824676 100644
--- a/drivers/media/video/marvell-ccic/mcam-core.c
+++ b/drivers/media/video/marvell-ccic/mcam-core.c
@@ -1564,11 +1564,8 @@ static int mcam_v4l_release(struct file *filp)
1564 singles, delivered); 1564 singles, delivered);
1565 mutex_lock(&cam->s_mutex); 1565 mutex_lock(&cam->s_mutex);
1566 (cam->users)--; 1566 (cam->users)--;
1567 if (filp == cam->owner) {
1568 mcam_ctlr_stop_dma(cam);
1569 cam->owner = NULL;
1570 }
1571 if (cam->users == 0) { 1567 if (cam->users == 0) {
1568 mcam_ctlr_stop_dma(cam);
1572 mcam_cleanup_vb2(cam); 1569 mcam_cleanup_vb2(cam);
1573 mcam_ctlr_power_down(cam); 1570 mcam_ctlr_power_down(cam);
1574 if (cam->buffer_mode == B_vmalloc && alloc_bufs_at_read) 1571 if (cam->buffer_mode == B_vmalloc && alloc_bufs_at_read)
diff --git a/drivers/media/video/marvell-ccic/mcam-core.h b/drivers/media/video/marvell-ccic/mcam-core.h
index 917200e6325..bd6acba9fb3 100644
--- a/drivers/media/video/marvell-ccic/mcam-core.h
+++ b/drivers/media/video/marvell-ccic/mcam-core.h
@@ -107,7 +107,6 @@ struct mcam_camera {
107 enum mcam_state state; 107 enum mcam_state state;
108 unsigned long flags; /* Buffer status, mainly (dev_lock) */ 108 unsigned long flags; /* Buffer status, mainly (dev_lock) */
109 int users; /* How many open FDs */ 109 int users; /* How many open FDs */
110 struct file *owner; /* Who has data access (v4l2) */
111 110
112 /* 111 /*
113 * Subsystem structures. 112 * Subsystem structures.