[media] media: omap3isp: fix a potential NULL deref
authorOhad Ben-Cohen <[email protected]>
Wed, 1 Jun 2011 16:39:46 +0000 (13:39 -0300)
committerMauro Carvalho Chehab <[email protected]>
Fri, 1 Jul 2011 02:01:05 +0000 (23:01 -0300)
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 <[email protected]>
Acked-by: Laurent Pinchart <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
drivers/media/video/omap3isp/isp.c

index c9fd04ee70a8ae766811059c6942657334ac7621..94b6ed89e195866e8eb1af83950faea772c7d0c6 100644 (file)
@@ -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;