diff options
| author | Ma Ke <make_ruc2021@163.com> | 2026-10-11 14:17:22 +0800 |
|---|---|---|
| committer | Linus Walleij <linusw@kernel.org> | 2026-10-14 01:36:14 +0200 |
| commit | 54c66b5e47a9b10cbf4a1efe9b01301b7ffee205 (patch) | |
| tree | c93f9868d0a8ef7a307c09a2e765311c81172ca5 /tools/lib/python/kdoc/python_version.py | |
| parent | 4f0dbdbdb3ad122e8bbfb1d722fd584bac7124db (diff) | |
| download | linux-next-54c66b5e47a9b10cbf4a1efe9b01301b7ffee205.tar.gz linux-next-54c66b5e47a9b10cbf4a1efe9b01301b7ffee205.zip | |
pinctrl: stm32: Fix fwnode reference leak in stm32_gpiolib_register_bank()
stm32_gpiolib_register_bank() walks the "gpio-ranges" property with
fwnode_property_get_reference_args(). As documented in
drivers/base/property.c:
* The caller is responsible for calling fwnode_handle_put() on the
* returned @args->fwnode pointer.
The returned reference is never put. The function calls the helper
twice, once directly and then repeatedly in a while loop, and each
call overwrites args, so only the last reference is even reachable
and all the earlier ones are leaked for good.
Put the reference as soon as args.args[] has been consumed, both for
the initial call and for every iteration of the loop.
Found by code review.
Cc: stable@vger.kernel.org
Fixes: bb949ed9b16b ("pinctrl: stm32: Switch to use for_each_gpiochip_node() helper")
Signed-off-by: Ma Ke <make_ruc2021@163.com>
Reviewed-by: Antonio Borneo <antonio.borneo@foss.st.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
