Skip to content

Commit 7b320cb

Browse files
Stanislaw Gruszkalinusw
authored andcommitted
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: 42fed7b ("pinctrl: move subsystem mutex to pinctrl_dev struct") Cc: [email protected] Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Stephen Warren <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent fa74d0d commit 7b320cb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/pinctrl/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,9 @@ static struct pinctrl *create_pinctrl(struct device *dev)
851851
kref_init(&p->users);
852852

853853
/* Add the pinctrl handle to the global list */
854+
mutex_lock(&pinctrl_list_mutex);
854855
list_add_tail(&p->node, &pinctrl_list);
856+
mutex_unlock(&pinctrl_list_mutex);
855857

856858
return p;
857859
}

0 commit comments

Comments
 (0)