diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2014-02-04 03:07:09 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-02-04 15:59:45 -0500 |
commit | 7b320cb1ed2dbd2c5f2a778197baf76fd6bf545a (patch) | |
tree | 635601d6b411639a5597069a73a2ff5b4321686a /drivers/pinctrl | |
parent | fa74d0d3e30cf079e94db327ea6d4726cd7d5871 (diff) |
pinctrl: protect pinctrl_list add
We have few fedora bug reports about list corruption on pinctrl,
for example:
https://bugzilla.redhat.com/show_bug.cgi?id=1051918
Most likely corruption happen due lack of protection of pinctrl_list
when adding new nodes to it. Patch corrects that.
Fixes: 42fed7ba44e ("pinctrl: move subsystem mutex to pinctrl_dev struct")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 5ee61a470016..cab020a58bf5 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -851,7 +851,9 @@ static struct pinctrl *create_pinctrl(struct device *dev) | |||
851 | kref_init(&p->users); | 851 | kref_init(&p->users); |
852 | 852 | ||
853 | /* Add the pinctrl handle to the global list */ | 853 | /* Add the pinctrl handle to the global list */ |
854 | mutex_lock(&pinctrl_list_mutex); | ||
854 | list_add_tail(&p->node, &pinctrl_list); | 855 | list_add_tail(&p->node, &pinctrl_list); |
856 | mutex_unlock(&pinctrl_list_mutex); | ||
855 | 857 | ||
856 | return p; | 858 | return p; |
857 | } | 859 | } |