Skip to content

Commit

Permalink
media: vimc: fix start stream when link is disabled
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Helen Fornazier authored and Mauro Carvalho Chehab committed Dec 7, 2018
1 parent ee494cf commit e159b60
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/platform/vimc/vimc-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e159b60

Please sign in to comment.