Re: [PATCH] regulator: core: Add locked version of regulator_putto avoid deadlock

From: Laxman Dewangan
Date: Tue Nov 13 2012 - 12:18:41 EST


On Tuesday 13 November 2012 10:00 PM, Charles Keepax wrote:
When regulator_register fails and exits through the scrub path the
regulator_put function was called whilst holding the
regulator_list_mutex, which is also locked from regulator_put, causing
deadlock.

This patch adds a locked version of the regulator_put function which can
be safely called whilst holding the mutex, replacing the aforementioned
call.

Signed-off-by: Charles Keepax<ckeepax@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Cc: Laxman Dewangan<ldewangan@xxxxxxxxxx>
---

I hope this isn't bad etiquette but I took the liberaty of fixing up
the patch as per the comments and taking into account the removal of
my original patch. Apologies if this is not the done thing, do let
me know if you would rather submit a version yourself but I
thought best to address the issue and get a fix in.

This looks fine.
Acked-by: Laxman Dewangan <ldewangan@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/