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

The return value of the set_config() callback may be propagated to
user-space. If a bad driver returns a positive number, it may confuse
user programs. Tighten the API contract and check for positive numbers
returned by GPIO controllers.

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