public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP 2: Camera: Fix device release
@ 2007-12-04 15:48 Sakari Ailus
  2007-12-05 22:42 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Sakari Ailus @ 2007-12-04 15:48 UTC (permalink / raw)
  To: linux-omap-open-source; +Cc: linux-omap

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>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM: OMAP 2: Camera: Fix device release
  2007-12-04 15:48 [PATCH] ARM: OMAP 2: Camera: Fix device release Sakari Ailus
@ 2007-12-05 22:42 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2007-12-05 22:42 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-omap, linux-omap-open-source

* Sakari Ailus <sakari.ailus@nokia.com> [071204 07:50]:
> 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>
> ---
>  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);
> -- 

Pushing today

Tony

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-12-05 22:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-04 15:48 [PATCH] ARM: OMAP 2: Camera: Fix device release Sakari Ailus
2007-12-05 22:42 ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox