gpiolib: allocate memory atomically with a spinlock held
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 12 Dec 2023 10:55:01 +0000 (11:55 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 15 Dec 2023 15:43:24 +0000 (16:43 +0100)
commit0a10d107818cc4def73723ba3101aae0d25ea353
tree082320c605c077a3f9ca8b1f3ed8108fafead054
parentd22f93c6a0df15b9d1f500ab57d97ecc99b3657a
gpiolib: allocate memory atomically with a spinlock held

We will eventually switch to protecting the GPIO descriptors with a mutex
but until then, we need to allocate memory for the label copy atomically
while we're holding the global spinlock.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-gpio/62588146-eed6-42f7-ba26-160226b109fe@moroto.mountain/T/#u
Fixes: f8d05e276b45 ("gpiolib: remove gpiochip_is_requested()")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c