diff options
author | Helen Fornazier <helen.koike@collabora.com> | 2018-12-07 12:56:41 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-12-07 13:08:41 -0500 |
commit | e159b6074c82fe31b79aad672e02fa204dbbc6d8 (patch) | |
tree | c43c57e524650c13fbdaea35103308ff8bcdc211 | |
parent | ee494cf377e142f65f202fadf0d859f8e12119fb (diff) |
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>
-rw-r--r-- | drivers/media/platform/vimc/vimc-common.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/platform/vimc/vimc-common.c b/drivers/media/platform/vimc/vimc-common.c index dee1b9dfc4f6..867e24dbd6b5 100644 --- a/drivers/media/platform/vimc/vimc-common.c +++ b/drivers/media/platform/vimc/vimc-common.c | |||
@@ -276,6 +276,8 @@ int vimc_pipeline_s_stream(struct media_entity *ent, int enable) | |||
276 | 276 | ||
277 | /* Start the stream in the subdevice direct connected */ | 277 | /* Start the stream in the subdevice direct connected */ |
278 | pad = media_entity_remote_pad(&ent->pads[i]); | 278 | pad = media_entity_remote_pad(&ent->pads[i]); |
279 | if (!pad) | ||
280 | continue; | ||
279 | 281 | ||
280 | if (!is_media_entity_v4l2_subdev(pad->entity)) | 282 | if (!is_media_entity_v4l2_subdev(pad->entity)) |
281 | return -EINVAL; | 283 | return -EINVAL; |