]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpio: cdev: Fix resource leaks on errors in gpiolib_cdev_register()
authorTzung-Bi Shih <tzungbi@kernel.org>
Tue, 20 Jan 2026 09:26:50 +0000 (09:26 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Jan 2026 09:32:27 +0000 (10:32 +0100)
commitab140fc93108360cfb53ff04592be05547aa5c0f
treed02c24f6f4a5f88a025b24ed9db7b54444f5035a
parent16414341b0dd58b650b5df45c79115bc5977bb76
gpio: cdev: Fix resource leaks on errors in gpiolib_cdev_register()

commit 8a8c942cad4cd12f739a8bb60cac77fd173c4e07 upstream.

On error handling paths, gpiolib_cdev_register() doesn't free the
allocated resources which results leaks.  Fix it.

Cc: stable@vger.kernel.org
Fixes: 7b9b77a8bba9 ("gpiolib: add a per-gpio_device line state notification workqueue")
Fixes: d83cee3d2bb1 ("gpio: protect the pointer to gpio_chip in gpio_device with SRCU")
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20260120092650.2305319-1-tzungbi@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpiolib-cdev.c