]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
media: vimc: fix start stream when link is disabled
authorHelen Fornazier <helen.koike@collabora.com>
Fri, 7 Dec 2018 17:56:41 +0000 (12:56 -0500)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:22:23 +0000 (14:22 -0300)
BugLink: https://bugs.launchpad.net/bugs/1857158
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/media/platform/vimc/vimc-common.c

index 743554de724d81cf46e6dd8444a683afc6beeac7..a9ab3871ccda2ac9ed99830fda493ee334987afe 100644 (file)
@@ -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;