From: Sakari Ailus Date: Tue, 4 Dec 2007 15:48:59 +0000 (+0200) Subject: ARM: OMAP 2: Camera: Fix device release X-Git-Tag: v2.6.24-omap1~118 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=eac754e49e5fbe1c7ac9c2c3108bdab3060e47a6;p=linux-2.6-omap-h63xx.git 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: Sakari Ailus Signed-off-by: Tony Lindgren --- diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c index d394eab38d4..96f488504ad 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);