aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s5p-fimc/fimc-capture.c
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2012-05-16 10:35:04 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-06-25 08:16:12 -0400
commit90e614bb4c581eb588ec26f130fcdd65aa047fa8 (patch)
tree36e7cbeb740ff76d314c6d5c93a695356c333b64 /drivers/media/video/s5p-fimc/fimc-capture.c
parentb6a509df59c6abd0a2177e3be29642207711145d (diff)
[media] s5p-fimc: Fix bug in capture node open()
When video pipeline initialization fails, the ST_CAPT_BUSY flag needs to be cleared before pm_runtime_put_sync is called. Otherwise the runtime suspend routine tries to suspend device, rather than just turning it off. Also fix potential null pointer dereference in fimc_pipeline_shutdown(). Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s5p-fimc/fimc-capture.c')
-rw-r--r--drivers/media/video/s5p-fimc/fimc-capture.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c
index 354574591908..7083107c2b37 100644
--- a/drivers/media/video/s5p-fimc/fimc-capture.c
+++ b/drivers/media/video/s5p-fimc/fimc-capture.c
@@ -499,10 +499,10 @@ static int fimc_capture_open(struct file *file)
499 if (ret < 0) { 499 if (ret < 0) {
500 dev_err(&fimc->pdev->dev, 500 dev_err(&fimc->pdev->dev,
501 "Video pipeline initialization failed\n"); 501 "Video pipeline initialization failed\n");
502 clear_bit(ST_CAPT_BUSY, &fimc->state);
502 pm_runtime_put_sync(&fimc->pdev->dev); 503 pm_runtime_put_sync(&fimc->pdev->dev);
503 fimc->vid_cap.refcnt--; 504 fimc->vid_cap.refcnt--;
504 v4l2_fh_release(file); 505 v4l2_fh_release(file);
505 clear_bit(ST_CAPT_BUSY, &fimc->state);
506 return ret; 506 return ret;
507 } 507 }
508 ret = fimc_capture_ctrls_create(fimc); 508 ret = fimc_capture_ctrls_create(fimc);