From: Helen Fornazier Date: Fri, 7 Dec 2018 17:56:41 +0000 (-0500) Subject: media: vimc: fix start stream when link is disabled X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~5716^2~7 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=e159b6074c82fe31b79aad672e02fa204dbbc6d8;p=linux.git 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 Signed-off-by: Mauro Carvalho Chehab --- 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) /* 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;