From 5bfa7a8df43baa8087af60998dd37af9ca5ecd33 Mon Sep 17 00:00:00 2001 From: Valmantas Paliksa Date: Fri, 22 Mar 2019 07:10:57 -0600 Subject: [PATCH] drivers/ioexpander/gpio.c: Return EINVAL if written value is not 0 nor 1. --- drivers/ioexpander/gpio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/ioexpander/gpio.c b/drivers/ioexpander/gpio.c index c650def5d8..70ebcee20a 100644 --- a/drivers/ioexpander/gpio.c +++ b/drivers/ioexpander/gpio.c @@ -251,6 +251,10 @@ static ssize_t gpio_write(FAR struct file *filep, FAR const char *buffer, { val = 1; } + else + { + return -EINVAL; + } /* Write the GPIO value */