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

The return value of the direction_input() callback may be propagated to
user-space. As per the API contract it can only return 0 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-7-12ea88506cb2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib.c