diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2025-07-18 16:22:15 -0500 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2025-07-19 18:06:47 +0200 |
commit | 5607f5ed3c5f30f41e72ce09c8e616af0fc0d474 (patch) | |
tree | 6756f45c771f0eea99dc07f856d6f549194a1d01 /scripts/lib/kdoc/kdoc_parser.py | |
parent | ae455b249449ad6306500324aa76f03b46295599 (diff) |
gpio: sysfs: Fix an end of loop test in gpiod_unexport()
The test for "if (!desc_data)" does not work correctly because the list
iterator in a list_for_each_entry() loop is always non-NULL. If we don't
exit via a break, then it points to invalid memory. Instead, use a tmp
variable for the list iterator and only set the "desc_data" when we have
found a match.
Fixes: 1cd53df733c2 ("gpio: sysfs: don't look up exported lines as class devices")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/747545bf-05f0-4f89-ba77-cb96bf9041f1@sabinyo.mountain
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions