diff options
author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-09-20 09:32:53 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-09-22 10:51:56 +0200 |
commit | 5cb9606a901a41f2ffe37fb8528bb6fbfb5d90e2 (patch) | |
tree | 0a16a3a20feb058b05da0bf29b8752497464b12b /tools/testing/selftests/bpf/prog_tests/async_stack_depth.c | |
parent | b547b5e52a0587e6b25ea520bf2f9e03d00cbcb6 (diff) |
gpio: sim: fix an invalid __free() usage
gpio_sim_make_line_names() returns NULL or ERR_PTR() so we must not use
__free(kfree) on the returned address. Split this function into two, one
that determines the size of the "gpio-line-names" array to allocate and
one that actually sets the names at correct offsets. The allocation and
assignment of the managed pointer happens in between.
Fixes: 3faf89f27aab ("gpio: sim: simplify code with cleanup helpers")
Reported-by: Alexey Dobriyan <adobriyan@gmail.com>
Closes: https://lore.kernel.org/all/07c32bf1-6c1a-49d9-b97d-f0ae4a2b42ab@p183/
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/async_stack_depth.c')
0 files changed, 0 insertions, 0 deletions