diff options
author | Helen Fornazier <helen.koike@collabora.com> | 2018-12-07 12:56:41 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-17 20:38:42 +0100 |
commit | 5ca05d9f18dbe4aa15f1417431d371c526be0776 (patch) | |
tree | 6328006e846bc91a235a83de1b36d50b992cbff9 /drivers | |
parent | 36e6f0ec773437ddc086e2b1b2ff71aa038e46b4 (diff) |
media: vimc: fix start stream when link is disabled
[ Upstream commit e159b6074c82fe31b79aad672e02fa204dbbc6d8 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-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 743554de724d..a9ab3871ccda 100644 --- a/drivers/media/platform/vimc/vimc-common.c +++ b/drivers/media/platform/vimc/vimc-common.c @@ -241,6 +241,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; |