summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/tegra
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2023-09-20 21:09:10 +0300
committerLinus Walleij <linus.walleij@linaro.org>2023-09-25 16:29:26 +0300
commitc153a4edff6ab01370fcac8e46f9c89cca1060c2 (patch)
tree168e8a4030c9a649143f4fce5ec889c300d80c9b /drivers/pinctrl/tegra
parent64061b67335e958e6328bcb5bb2b5490d57f3f59 (diff)
downloadlinux-c153a4edff6ab01370fcac8e46f9c89cca1060c2.tar.xz
pinctrl: avoid unsafe code pattern in find_pinctrl()
The code in find_pinctrl() takes a mutex and traverses a list of pinctrl structures. Later the caller bumps up reference count on the found structure. Such pattern is not safe as pinctrl that was found may get deleted before the caller gets around to increasing the reference count. Fix this by taking the reference count in find_pinctrl(), while it still holds the mutex. Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://lore.kernel.org/r/ZQs1RgTKg6VJqmPs@google.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/tegra')
0 files changed, 0 insertions, 0 deletions