Re: [PATCH v2] regulator: core: fix race condition in regulator_put()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: Digital signature


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux