]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pinctrl: samsung: fix fwnode refcount cleanup if platform_get_irq_optional() fails
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Wed, 6 Nov 2024 22:04:39 +0000 (23:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 12:49:53 +0000 (13:49 +0100)
commitcd78038467da89be1b15a649d900344730be39a8
tree690d266a8a4fe8ddfbf4ce7358fd618500f19f89
parent3b88ea45a64bc3b13dfcaaf52b2de97b8b19287d
pinctrl: samsung: fix fwnode refcount cleanup if platform_get_irq_optional() fails

commit 459915f55509f4bfd6076daa1428e28490ddee3b upstream.

Commit 50ebd19e3585 ("pinctrl: samsung: drop pin banks references on
error paths") fixed the pin bank references on the error paths of the
probe function, but there is still an error path where this is not done.

If samsung_pinctrl_get_soc_data() does not fail, the child references
will have acquired, and they will need to be released in the error path
of platform_get_irq_optional(), as it is done in the following error
paths within the probe function.

Replace the direct return in the error path with a goto instruction to
the cleanup function.

Cc: stable@vger.kernel.org
Fixes: a382d568f144 ("pinctrl: samsung: Use platform_get_irq_optional() to get the interrupt")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241106-samsung-pinctrl-put-v1-1-de854e26dd03@gmail.com
[krzysztof: change Fixes SHA to point to commit introducing the return
 leading to OF node leak]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pinctrl/samsung/pinctrl-samsung.c