]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP 2: Camera: Fix device release
authorSakari Ailus <sakari.ailus@nokia.com>
Tue, 4 Dec 2007 15:48:59 +0000 (17:48 +0200)
committerTony Lindgren <tony@atomide.com>
Wed, 5 Dec 2007 22:41:39 +0000 (14:41 -0800)
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>
drivers/media/video/omap24xxcam.c

index d394eab38d4ca6eef9072edde32fb3f73662d901..96f488504ad7ca8f327c3da3bb707a19d15d68e0 100644 (file)
@@ -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);