Skip to contentSkip to conversation

media: vimc: fix start stream when link is disabled

PATCH New Helen Koike 1 participant 1 message Dec 7, 2018 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

 drivers/media/platform/vimc/vimc-common.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/media/platform/vimc/vimc-common.c +2 -0
index dee1b9dfc4f6..867e24dbd6b5 100644
@@ -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;
Signature · 1 line
2.19.1