diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-07-31 11:12:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-09-11 08:49:27 -0400 |
commit | 00542edf071e249ccb541ffb2d2b9034e2533968 (patch) | |
tree | 4fcde884ee297fa8fa1768ee28bd7927bb7ce610 /drivers/media/video/omap3isp | |
parent | b796fb6ed032b0ccdb769b3b3bce5fb2b186a8f8 (diff) |
[media] omap3isp: Don't accept pipelines with no video source as valid
Make sure the pipeline has a valid video source (either a subdev with no
sink pad, or a non-subdev entity) at stream-on time and return -EPIPE if
no video source can be found.
Reported-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/omap3isp')
-rw-r--r-- | drivers/media/video/omap3isp/ispvideo.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/media/video/omap3isp/ispvideo.c b/drivers/media/video/omap3isp/ispvideo.c index fd965adfd597..fd94cdf471bc 100644 --- a/drivers/media/video/omap3isp/ispvideo.c +++ b/drivers/media/video/omap3isp/ispvideo.c | |||
@@ -278,7 +278,8 @@ isp_video_far_end(struct isp_video *video) | |||
278 | * limits reported by every block in the pipeline. | 278 | * limits reported by every block in the pipeline. |
279 | * | 279 | * |
280 | * Return 0 if all formats match, or -EPIPE if at least one link is found with | 280 | * Return 0 if all formats match, or -EPIPE if at least one link is found with |
281 | * different formats on its two ends. | 281 | * different formats on its two ends or if the pipeline doesn't start with a |
282 | * video source (either a subdev with no input pad, or a non-subdev entity). | ||
282 | */ | 283 | */ |
283 | static int isp_video_validate_pipeline(struct isp_pipeline *pipe) | 284 | static int isp_video_validate_pipeline(struct isp_pipeline *pipe) |
284 | { | 285 | { |
@@ -329,10 +330,15 @@ static int isp_video_validate_pipeline(struct isp_pipeline *pipe) | |||
329 | * in the middle of it. */ | 330 | * in the middle of it. */ |
330 | shifter_link = subdev == &isp->isp_ccdc.subdev; | 331 | shifter_link = subdev == &isp->isp_ccdc.subdev; |
331 | 332 | ||
332 | /* Retrieve the source format */ | 333 | /* Retrieve the source format. Return an error if no source |
334 | * entity can be found, and stop checking the pipeline if the | ||
335 | * source entity isn't a subdev. | ||
336 | */ | ||
333 | pad = media_entity_remote_source(pad); | 337 | pad = media_entity_remote_source(pad); |
334 | if (pad == NULL || | 338 | if (pad == NULL) |
335 | media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) | 339 | return -EPIPE; |
340 | |||
341 | if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) | ||
336 | break; | 342 | break; |
337 | 343 | ||
338 | subdev = media_entity_to_v4l2_subdev(pad->entity); | 344 | subdev = media_entity_to_v4l2_subdev(pad->entity); |