All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Lad Prabhakar <prabhakar.csengg@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] media: i2c: mt9p031: make sure we destroy the mutex
Date: Fri, 27 Feb 2015 01:19:33 +0200	[thread overview]
Message-ID: <1655258.KMH9gfjzu0@avalon> (raw)
In-Reply-To: <1424973938-26121-1-git-send-email-prabhakar.csengg@gmail.com>

Hi Prabhakar,

Thank you for the patch.

On Thursday 26 February 2015 18:05:38 Lad Prabhakar wrote:
> From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
> 
> this patch makes sure to call mutex_destroy() in
> case of probe failure or module unload.
> 
> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

and applied to my tree with a slightly modified commit message:

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

> ---
>  drivers/media/i2c/mt9p031.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
> index e3acae9..af5a09d 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;
>  }

-- 
Regards,

Laurent Pinchart


      reply	other threads:[~2015-02-26 23:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26 18:05 [PATCH] media: i2c: mt9p031: make sure we destroy the mutex Lad Prabhakar
2015-02-26 23:19 ` Laurent Pinchart [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1655258.KMH9gfjzu0@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=prabhakar.csengg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.