Commit ca4186f0 authored by Ohad Ben-Cohen's avatar Ohad Ben-Cohen Committed by Mauro Carvalho Chehab

[media] media: omap3isp: fix a potential NULL deref

Fix a potential NULL pointer dereference by skipping registration of
external entities in case none are provided.

This is useful at least when testing mere memory-to-memory scenarios.
Signed-off-by: default avatarOhad Ben-Cohen <ohad@wizery.com>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 66072d4f
...@@ -1748,7 +1748,7 @@ static int isp_register_entities(struct isp_device *isp) ...@@ -1748,7 +1748,7 @@ static int isp_register_entities(struct isp_device *isp)
goto done; goto done;
/* Register external entities */ /* Register external entities */
for (subdevs = pdata->subdevs; subdevs->subdevs; ++subdevs) { for (subdevs = pdata->subdevs; subdevs && subdevs->subdevs; ++subdevs) {
struct v4l2_subdev *sensor; struct v4l2_subdev *sensor;
struct media_entity *input; struct media_entity *input;
unsigned int flags; unsigned int flags;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment