All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] Extcon: Arizona: unlock on an error in arizona_micdet()
Date: Thu, 12 Jul 2012 16:19:29 +0000	[thread overview]
Message-ID: <4FFEF911.5010001@bfs.de> (raw)
In-Reply-To: <20120711063602.GG11812@elgon.mountain>



Am 11.07.2012 08:36, schrieb Dan Carpenter:
> Smatch complains about this.  I don't have a way to test this, but it
> does look like we should unlock on error here.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
> index b068bc9..4782884 100644
> --- a/drivers/extcon/extcon-arizona.c
> +++ b/drivers/extcon/extcon-arizona.c
> @@ -154,6 +154,7 @@ static irqreturn_t arizona_micdet(int irq, void *data)
>  	ret = regmap_read(arizona->regmap, ARIZONA_MIC_DETECT_3, &val);
>  	if (ret != 0) {
>  		dev_err(arizona->dev, "Failed to read MICDET: %d\n", ret);
> +		mutex_unlock(&info->lock);
>  		return IRQ_NONE;
>  	}
>  
> --
nitpicking:
normally you unlock before dev_err() and is the msg ok ?
IMHO  "Failed to read ARIZONA_MIC_DETECT_3:%d\n" seems more obvious,
(I really do not know that device)

re,
 wh

  parent reply	other threads:[~2012-07-12 16:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11  6:36 [patch] Extcon: Arizona: unlock on an error in arizona_micdet() Dan Carpenter
2012-07-11  6:36 ` Dan Carpenter
2012-07-11 23:55 ` Chanwoo Choi
2012-07-11 23:55   ` Chanwoo Choi
2012-07-12 16:19 ` walter harms [this message]
2012-07-12 16:24 ` Dan Carpenter
2012-07-12 17:27 ` Mark Brown
2012-07-12 17:30 ` Mark Brown
2012-07-12 17:30   ` Mark Brown

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=4FFEF911.5010001@bfs.de \
    --to=wharms@bfs.de \
    --cc=kernel-janitors@vger.kernel.org \
    /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.