gpio: cdev: fix missed label sanitizing in debounce_setup()
authorKent Gibson <warthog618@gmail.com>
Thu, 4 Apr 2024 09:33:28 +0000 (11:33 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 4 Apr 2024 16:57:08 +0000 (18:57 +0200)
commit83092341e15d0dfee1caa8dc502f66c815ccd78a
tree25798b039981a6e2897c624509d19e399e9bd988
parentb3b95964590a3d756d69ea8604c856de805479ad
gpio: cdev: fix missed label sanitizing in debounce_setup()

When adding sanitization of the label, the path through
edge_detector_setup() that leads to debounce_setup() was overlooked.
A request taking this path does not allocate a new label and the
request label is freed twice when the request is released, resulting
in memory corruption.

Add label sanitization to debounce_setup().

Cc: stable@vger.kernel.org
Fixes: b34490879baa ("gpio: cdev: sanitize the label before requesting the interrupt")
Signed-off-by: Kent Gibson <warthog618@gmail.com>
[Bartosz: rebased on top of the fix for empty GPIO labels]
Co-developed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib-cdev.c