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

The return value of the direction_output() 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-6-12ea88506cb2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib.c