summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorOhad Ben-Cohen <ohad@wizery.com>2011-06-01 13:39:46 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-06-30 23:01:05 -0300
commitca4186f06fecbf2b692a42cdea54b7ef23b2496c (patch)
tree80f5438034d6612ac4b18f35a14ed9c66d254663 /drivers/media
parent66072d4fa7cb644f1f064e290f8fddfbd8ccd478 (diff)
[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: Ohad Ben-Cohen <ohad@wizery.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/omap3isp/isp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/omap3isp/isp.c b/drivers/media/video/omap3isp/isp.c
index c9fd04ee70a..94b6ed89e19 100644
--- a/drivers/media/video/omap3isp/isp.c
+++ b/drivers/media/video/omap3isp/isp.c
@@ -1748,7 +1748,7 @@ static int isp_register_entities(struct isp_device *isp)
goto done;
/* Register external entities */
- for (subdevs = pdata->subdevs; subdevs->subdevs; ++subdevs) {
+ for (subdevs = pdata->subdevs; subdevs && subdevs->subdevs; ++subdevs) {
struct v4l2_subdev *sensor;
struct media_entity *input;
unsigned int flags;