]> www.infradead.org Git - users/jedix/linux-maple.git/commit
gpiolib: sanitize the return value of gpio_chip::get()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 10 Feb 2025 10:51:58 +0000 (11:51 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 24 Feb 2025 08:58:58 +0000 (09:58 +0100)
commit86ef402d805d606a10e6da8e5a64a51f6f5fb7e2
treea93b72be9683e9193f31f4f756996b48e926c721
parentdcf8f3bffa2de2c7f3b5771b63605194ccd2286f
gpiolib: sanitize the return value of gpio_chip::get()

As per the API contract, the get() callback is only allowed to return 0,
1 or a negative error number. Add a wrapper around the callback calls
that filters out anything else.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250210-gpio-sanitize-retvals-v1-4-12ea88506cb2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib.c