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: v4.19.89~62 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=21a16d1ac916baca3dfeba17788c40dba4303cc3;p=thirdparty%2Fkernel%2Fstable.git 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 Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- diff --git a/drivers/media/platform/vimc/vimc-common.c b/drivers/media/platform/vimc/vimc-common.c index 204aa6f554e4d..fa8435ac2b1ae 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;