This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/media_tree.git tree:

Subject: [media] media: i2c: mt9p031: make sure we destroy the mutex
Author:  Lad, Prabhakar <[email protected]>
Date:    Thu Feb 26 15:05:38 2015 -0300

Make sure to call mutex_destroy() in case of probe failure or module
unload.

Signed-off-by: Lad, Prabhakar <[email protected]>
Signed-off-by: Laurent Pinchart <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/i2c/mt9p031.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=15af4a532f7fb21f7e02973a4829735ce13190c0

diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
index e06759c..2bf0e68 100644
--- a/drivers/media/i2c/mt9p031.c
+++ b/drivers/media/i2c/mt9p031.c
@@ -1071,6 +1071,8 @@ static int mt9p031_probe(struct i2c_client *client,
                return ret;
        }
 
+       mutex_init(&mt9p031->power_lock);
+
        v4l2_ctrl_handler_init(&mt9p031->ctrls, ARRAY_SIZE(mt9p031_ctrls) + 6);
 
        v4l2_ctrl_new_std(&mt9p031->ctrls, &mt9p031_ctrl_ops,
@@ -1108,7 +1110,6 @@ static int mt9p031_probe(struct i2c_client *client,
        mt9p031->blc_offset = v4l2_ctrl_find(&mt9p031->ctrls,
                                             V4L2_CID_BLC_DIGITAL_OFFSET);
 
-       mutex_init(&mt9p031->power_lock);
        v4l2_i2c_subdev_init(&mt9p031->subdev, client, &mt9p031_subdev_ops);
        mt9p031->subdev.internal_ops = &mt9p031_subdev_internal_ops;
 
@@ -1149,6 +1150,7 @@ done:
        if (ret < 0) {
                v4l2_ctrl_handler_free(&mt9p031->ctrls);
                media_entity_cleanup(&mt9p031->subdev.entity);
+               mutex_destroy(&mt9p031->power_lock);
        }
 
        return ret;
@@ -1162,6 +1164,7 @@ static int mt9p031_remove(struct i2c_client *client)
        v4l2_ctrl_handler_free(&mt9p031->ctrls);
        v4l2_device_unregister_subdev(subdev);
        media_entity_cleanup(&subdev->entity);
+       mutex_destroy(&mt9p031->power_lock);
 
        return 0;
 }

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to