linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: omap3isp: fix a pontential NULL deref
@ 2011-06-01 16:39 Ohad Ben-Cohen
  2011-06-02 16:49 ` Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: Ohad Ben-Cohen @ 2011-06-01 16:39 UTC (permalink / raw)
  To: linux-media; +Cc: laurent.pinchart, linux-omap, Ohad Ben-Cohen

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>
---
 drivers/media/video/omap3isp/isp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/omap3isp/isp.c b/drivers/media/video/omap3isp/isp.c
index 2a5fbe6..367ced3 100644
--- a/drivers/media/video/omap3isp/isp.c
+++ b/drivers/media/video/omap3isp/isp.c
@@ -1756,7 +1756,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;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-02 16:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-01 16:39 [PATCH] media: omap3isp: fix a pontential NULL deref Ohad Ben-Cohen
2011-06-02 16:49 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).