The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@ti.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: Fix double free in devm_regulator_put()
Date: Fri, 15 Jun 2012 11:03:50 -0700	[thread overview]
Message-ID: <1339783430.26435.2.camel@joe2Laptop> (raw)
In-Reply-To: <1339782943-16652-1-git-send-email-broonie@opensource.wolfsonmicro.com>

On Fri, 2012-06-15 at 18:55 +0100, Mark Brown wrote:
> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
[]
> @@ -1461,9 +1461,7 @@ void devm_regulator_put(struct regulator *regulator)
>  
>  	rc = devres_release(regulator->dev, devm_regulator_release,
>  			    devm_regulator_match, regulator);
> -	if (rc == 0)
> -		regulator_put(regulator);
> -	else
> +	if (rc != 0)
>  		WARN_ON(rc);

Seems an odd style choice.  Perhaps:

	rc = devres_release(regulator->dev, devm_regulator_release,
			    devm_regulator_match, regulator);
	WARN_ON(rc);



      reply	other threads:[~2012-06-15 18:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15 17:55 [PATCH] regulator: Fix double free in devm_regulator_put() Mark Brown
2012-06-15 18:03 ` Joe Perches [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=1339783430.26435.2.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox