summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-xtensa.c
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>2023-08-11 22:30:34 +0300
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2023-08-16 14:35:50 +0300
commit3386fb86ecdef0d39ee3306aea8ec290e61b934f (patch)
tree665aafebab585a83dfedd8b584b8e00c19546f44 /drivers/gpio/gpio-xtensa.c
parent20d9b3b5f2749673e1b5e9c8b0846ff6deff4032 (diff)
downloadlinux-3386fb86ecdef0d39ee3306aea8ec290e61b934f.tar.xz
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 'drivers/gpio/gpio-xtensa.c')
0 files changed, 0 insertions, 0 deletions