Commit eac754e4 authored by Sakari Ailus's avatar Sakari Ailus Committed by Tony Lindgren

ARM: OMAP 2: Camera: Fix device release

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: default avatarSakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 80919be9
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment