]> www.infradead.org Git - users/jedix/linux-maple.git/commit
gpiolib: sanitize the return value of gpio_chip::get_direction()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 10 Feb 2025 10:52:02 +0000 (11:52 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 24 Feb 2025 09:02:36 +0000 (10:02 +0100)
commite623c4303ed112a1fc20aec8427ba8407e2842e6
treeb87193b1a20af65134e1b72e3a078143f1a6dcaf
parent4750ddce95ae8be618e31b0aa51efcf50e23a78e
gpiolib: sanitize the return value of gpio_chip::get_direction()

As per the API contract, the get_direction() callback can only
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-8-12ea88506cb2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib.c