public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] adp1653: check error code of adp1653_init_controls
@ 2011-07-27  7:58 Andy Shevchenko
  2011-07-27  8:15 ` Sakari Ailus
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2011-07-27  7:58 UTC (permalink / raw)
  To: linux-media, linux-kernel
  Cc: Andy Shevchenko, Mauro Carvalho Chehab, Sakari Ailus

Potentially the adp1653_init_controls could return an error. In our case the
error was ignored, meanwhile it means incorrect initialization of V4L2
controls.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
---
 drivers/media/video/adp1653.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c
index 8ad89ff..3379e6d 100644
--- a/drivers/media/video/adp1653.c
+++ b/drivers/media/video/adp1653.c
@@ -429,7 +429,11 @@ static int adp1653_probe(struct i2c_client *client,
 	flash->subdev.internal_ops = &adp1653_internal_ops;
 	flash->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 
-	adp1653_init_controls(flash);
+	ret = adp1653_init_controls(flash);
+	if (ret) {
+		kfree(flash);
+		return ret;
+	}
 
 	ret = media_entity_init(&flash->subdev.entity, 0, NULL, 0);
 	if (ret < 0)
-- 
1.7.5.4


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

end of thread, other threads:[~2011-07-29  7:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-27  7:58 [PATCH] adp1653: check error code of adp1653_init_controls Andy Shevchenko
2011-07-27  8:15 ` Sakari Ailus
2011-07-28  7:55   ` Andy Shevchenko
2011-07-28  7:59   ` [PATCHv2] " Andy Shevchenko
2011-07-28 14:34     ` Laurent Pinchart
2011-07-29  7:10       ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox