ARM: OMAP 2: Camera: Fix device release
PATCH 1/1 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 <[email protected]>
--- drivers/media/video/omap24xxcam.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/media/video/omap24xxcam.c +3 -2
@@ -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);
Signature · 1 line
1.5.0.6
Quoted 20 lines · Sakari Ailus
If streaming wasn't stopped before a file handle was closed,
videobuf_streamoffgot called aftercam->streaminghad been set NULL, causing an oops. Callvideobuf_streamoffa bit earlier instead.Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/video/omap24xxcam.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)drivers/media/video/omap24xxcam.c +0
-1@@ -1510,12 +1510,13 @@ static int omap24xxcam_release(struct inode *inode, struct file *file)flush_scheduled_work (); -mutex_lock (&cam->mutex);/* stop streaming capture */
drivers/media/video/omap24xxcam.c static int omap24xxcam_release(struct inode *inode, struct file *file) · line 1522
Quoted 10 lines
drivers/media/video/omap24xxcam.c +3
-1+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