mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-13 08:39:52 +00:00
pinctrl: core: Hold pinctrldev_list_mutex mutex while traversing pinctrldev_list
This one is missed in commit 44d5f7bb "pinctrl: sink pinctrldev_list_mutex". Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
031b8ce01b
commit
f005902108
@ -392,6 +392,8 @@ static int pinctrl_get_device_gpio_range(unsigned gpio,
|
||||
{
|
||||
struct pinctrl_dev *pctldev = NULL;
|
||||
|
||||
mutex_lock(&pinctrldev_list_mutex);
|
||||
|
||||
/* Loop over the pin controllers */
|
||||
list_for_each_entry(pctldev, &pinctrldev_list, node) {
|
||||
struct pinctrl_gpio_range *range;
|
||||
@ -400,10 +402,13 @@ static int pinctrl_get_device_gpio_range(unsigned gpio,
|
||||
if (range != NULL) {
|
||||
*outdev = pctldev;
|
||||
*outrange = range;
|
||||
mutex_unlock(&pinctrldev_list_mutex);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
mutex_unlock(&pinctrldev_list_mutex);
|
||||
|
||||
return -EPROBE_DEFER;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user