mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Ashay Jaiswal <ashayj@codeaurora.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	Anirudh Ghayal <aghayal@codeaurora.org>,
	David Collins <collinsd@codeaurora.org>
Subject: Re: [PATCH v2] regulator: core: fix race condition in regulator_put()
Date: Thu, 8 Jan 2015 18:15:56 +0000	[thread overview]
Message-ID: <20150108181556.GR2634@sirena.org.uk> (raw)
In-Reply-To: <1420723465-12045-1-git-send-email-ashayj@codeaurora.org>

[-- Attachment #1: Type: text/plain, Size: 732 bytes --]

On Thu, Jan 08, 2015 at 06:54:25PM +0530, Ashay Jaiswal wrote:
> The regulator framework maintains a list of consumer regulators
> for a regulator device and protects it from concurrent access using
> the regulator device's mutex lock.

Applied, thanks but...

> +	mutex_lock(&rdev->mutex);
>  	kfree(regulator->supply_name);
>  	list_del(&regulator->list);
>  	kfree(regulator);
> 
>  	rdev->open_count--;
>  	rdev->exclusive = 0;
> +	mutex_unlock(&rdev->mutex);

I'll do a followup which moves the frees out of the locked region
(reordering things a bit) - they're the main bit I was worried about
with time, they should be fast since they're just frees but it's easy
enough to avoid having to think about it.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

      reply	other threads:[~2015-01-08 18:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08 13:24 Ashay Jaiswal
2015-01-08 18:15 ` Mark Brown [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=20150108181556.GR2634@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=aghayal@codeaurora.org \
    --cc=ashayj@codeaurora.org \
    --cc=collinsd@codeaurora.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome