]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pinctrl: avoid reload of p state in list iteration
authorMaria Yu <quic_aiquny@quicinc.com>
Wed, 15 Nov 2023 10:28:24 +0000 (18:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Dec 2023 07:41:59 +0000 (08:41 +0100)
commitb872d80d845249cac9c689789107a0c6806df748
treeb1449b13faa22826e40490b867fec5b6af531ee0
parent7dfe8f6ecf6c49dce89197a1e51df09ab805be68
pinctrl: avoid reload of p state in list iteration

commit 4198a9b571065978632276264e01d71d68000ac5 upstream.

When in the list_for_each_entry iteration, reload of p->state->settings
with a local setting from old_state will turn the list iteration into an
infinite loop.

The typical symptom when the issue happens, will be a printk message like:

  "not freeing pin xx (xxx) as part of deactivating group xxx - it is
already used for some other setting".

This is a compiler-dependent problem, one instance occurred using Clang
version 10.0 on the arm64 architecture with linux version 4.19.

Fixes: 6e5e959dde0d ("pinctrl: API changes to support multiple states per device")
Signed-off-by: Maria Yu <quic_aiquny@quicinc.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20231115102824.23727-1-quic_aiquny@quicinc.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pinctrl/core.c