media: vimc: fix start stream when link is disabled

If link is disabled, media_entity_remote_pad returns NULL, causing a
NULL pointer deference.
Ignore links that are not enabled instead.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
Helen Fornazier 2018-12-07 12:56:41 -05:00 committed by Mauro Carvalho Chehab
parent ee494cf377
commit e159b6074c
1 changed files with 2 additions and 0 deletions

View File

@ -276,6 +276,8 @@ int vimc_pipeline_s_stream(struct media_entity *ent, int enable)
/* Start the stream in the subdevice direct connected */
pad = media_entity_remote_pad(&ent->pads[i]);
if (!pad)
continue;
if (!is_media_entity_v4l2_subdev(pad->entity))
return -EINVAL;