diff options
author | Suraj Sonawane <surajsonawane0215@gmail.com> | 2024-10-26 12:06:42 +0300 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2024-10-31 15:39:25 +0300 |
commit | a14968aea637bbe38a99e6089944e4ad8e6c49e5 (patch) | |
tree | 880eab93d14db2a7151af7d6936370f0a491e545 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | 81983758430957d9a5cb3333fe324fd70cf63e7e (diff) | |
download | linux-a14968aea637bbe38a99e6089944e4ad8e6c49e5.tar.xz |
gpio: fix uninit-value in swnode_find_gpio
Fix an issue detected by the Smatch tool:
drivers/gpio/gpiolib-swnode.c:78 swnode_find_gpio() error:
uninitialized symbol 'ret'.
The issue occurs because the 'ret' variable may be used without
initialization if the for_each_gpio_property_name loop does not run.
This could lead to returning an undefined value, causing unpredictable
behavior.
Initialize 'ret' to 0 before the loop to ensure the function
returns an error code if no properties are parsed, maintaining proper
error handling.
Fixes: 9e4c6c1ad ("Merge tag 'io_uring-6.12-20241011' of git://git.kernel.dk/linux")
Signed-off-by: Suraj Sonawane <surajsonawane0215@gmail.com>
Link: https://lore.kernel.org/r/20241026090642.28633-1-surajsonawane0215@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions