summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorLiu Ying <b17645@freescale.com>2010-10-25 14:01:28 +0800
committerAndy Voltz <andy.voltz@timesys.com>2011-06-01 13:19:36 -0400
commited5daca7f7d8fbbf45e4ec418a06dae24bbab1f6 (patch)
treecf1062d06ce38f6b70f818ff11679a33332f66e3 /drivers/media
parentb32d420b7903d795beed759decc2799b5ec6e971 (diff)
ENGR00132882 MXC V4L2 capture:Check slave is present when open dev
This patch makes sure that slave device is present when opening related video device. It will avoid a kernel dump if slave device is not present before calling custom open function. Signed-off-by: Liu Ying <b17645@freescale.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/mxc/capture/mxc_v4l2_capture.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c
index 56cc875d2da8..308f949d44ad 100644
--- a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c
+++ b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c
@@ -1374,6 +1374,12 @@ static int mxc_v4l_open(struct file *file)
return -EBADF;
}
+ if (cam->sensor == NULL ||
+ cam->sensor->type != v4l2_int_type_slave) {
+ pr_err("ERROR: v4l2 capture: slave not found!\n");
+ return -EAGAIN;
+ }
+
down(&cam->busy_lock);
err = 0;
if (signal_pending(current))