diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2011-07-28 03:59:38 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-08-06 08:43:57 -0400 |
commit | 31ee95ec2d3dd3b6f68d7fa0f410045652895af2 (patch) | |
tree | 2464cc21d0290ec32fef93fdcdee98228353609f /drivers/media/video/adp1653.c | |
parent | 572064280ecc9dc89227cf3797bc2144896a34f5 (diff) |
[media] adp1653: check error code of adp1653_init_controls
Potentially the adp1653_init_controls could return an error. In our case the
error was ignored, meanwhile it means incorrect initialization of V4L2
controls. Additionally we have to free control handler structures in case of
apd1653_init_controls or media_entity_init failure.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/adp1653.c')
-rw-r--r-- | drivers/media/video/adp1653.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c index 8ad89ffe2cc3..279d75d38188 100644 --- a/drivers/media/video/adp1653.c +++ b/drivers/media/video/adp1653.c | |||
@@ -429,12 +429,19 @@ static int adp1653_probe(struct i2c_client *client, | |||
429 | flash->subdev.internal_ops = &adp1653_internal_ops; | 429 | flash->subdev.internal_ops = &adp1653_internal_ops; |
430 | flash->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; | 430 | flash->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; |
431 | 431 | ||
432 | adp1653_init_controls(flash); | 432 | ret = adp1653_init_controls(flash); |
433 | if (ret) | ||
434 | goto free_and_quit; | ||
433 | 435 | ||
434 | ret = media_entity_init(&flash->subdev.entity, 0, NULL, 0); | 436 | ret = media_entity_init(&flash->subdev.entity, 0, NULL, 0); |
435 | if (ret < 0) | 437 | if (ret < 0) |
436 | kfree(flash); | 438 | goto free_and_quit; |
437 | 439 | ||
440 | return 0; | ||
441 | |||
442 | free_and_quit: | ||
443 | v4l2_ctrl_handler_free(&flash->ctrls); | ||
444 | kfree(flash); | ||
438 | return ret; | 445 | return ret; |
439 | } | 446 | } |
440 | 447 | ||