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@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
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);