gpio: shared: fix NULL-pointer dereference in teardown path
authorBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Sat, 6 Dec 2025 11:53:53 +0000 (12:53 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Tue, 9 Dec 2025 06:16:45 +0000 (07:16 +0100)
commite2c4175b8d3b3ea65fc3801c190bd93fe8b7a7a9
tree37da4f50af971ee8ac3efc6676ec0d7fba54e853
parent9e7a40a2841483d7bf51b8d9a5e1f0633a5c7a26
gpio: shared: fix NULL-pointer dereference in teardown path

We need to actually store the address of the GPIO lookup table in the
reference struct before we try to free it or - worse - dereference its
members.

Fixes: a060b8c511ab ("gpiolib: implement low-level, shared GPIO support")
Link: https://lore.kernel.org/r/20251206-gpio-shared-teardown-fixes-v1-1-35ac458cfce1@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpiolib-shared.c