diff options
author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-08-11 21:30:34 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-08-16 13:35:50 +0200 |
commit | 3386fb86ecdef0d39ee3306aea8ec290e61b934f (patch) | |
tree | 665aafebab585a83dfedd8b584b8e00c19546f44 /MAINTAINERS | |
parent | 20d9b3b5f2749673e1b5e9c8b0846ff6deff4032 (diff) |
gpiolib: fix reference leaks when removing GPIO chips still in use
After we remove a GPIO chip that still has some requested descriptors,
gpiod_free_commit() will fail and we will never put the references to the
GPIO device and the owning module in gpiod_free().
Rework this function to:
- not warn on desc == NULL as this is a use-case on which most free
functions silently return
- put the references to desc->gdev and desc->gdev->owner unconditionally
so that the release callback actually gets called when the remaining
references are dropped by external GPIO users
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'MAINTAINERS')
0 files changed, 0 insertions, 0 deletions