[PATCH] ARM: OMAP 2: Camera: Fix device release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If streaming wasn't stopped before a file handle was closed,
videobuf_streamoff got called after cam->streaming had been set NULL,
causing an oops. Call videobuf_streamoff a bit earlier instead.

Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxx>
---
 drivers/media/video/omap24xxcam.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c
index d394eab..96f4885 100644
--- a/drivers/media/video/omap24xxcam.c
+++ b/drivers/media/video/omap24xxcam.c
@@ -1510,12 +1510,13 @@ static int omap24xxcam_release(struct inode *inode, struct file *file)
 
 	flush_scheduled_work();
 
-	mutex_lock(&cam->mutex);
 	/* stop streaming capture */
+	videobuf_streamoff(&fh->vbq);
+
+	mutex_lock(&cam->mutex);
 	if (cam->streaming == file) {
 		cam->streaming = NULL;
 		mutex_unlock(&cam->mutex);
-		videobuf_streamoff(&fh->vbq);
 		sysfs_notify(&cam->dev->kobj, NULL, "streaming");
 	} else {
 		mutex_unlock(&cam->mutex);
-- 
1.5.0.6

-
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux