diff options
| author | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-01-08 11:23:14 +0100 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-01-08 15:23:15 +0100 |
| commit | 36f597bba049928004a050c132ab787ba0eba524 (patch) | |
| tree | 65b1483641ab20dc467dc68a9c309e843d1e9983 /tools/perf/scripts/python/bin/git@git.tavy.me:linux.git | |
| parent | a80208072df8f4ceb53cd905c1f4362f84ce397f (diff) | |
gpiolib: fix lookup table matching
If on any iteration in gpiod_find(), gpio_desc_table_match() returns
NULL (which is normal and expected), we never reinitialize desc back to
ERR_PTR(-ENOENT) and if we don't find a match later on, we will return
NULL causing a NULL-pointer dereference in users not expecting it. Don't
initialize desc, but return ERR_PTR(-ENOENT) explicitly at the end of
the function.
Fixes: 9700b0fccf38 ("gpiolib: allow multiple lookup tables per consumer")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Closes: https://lore.kernel.org/all/00107523-7737-4b92-a785-14ce4e93b8cb@samsung.com/
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20260108102314.18816-1-bartosz.golaszewski@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'tools/perf/scripts/python/bin/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
