[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1565469607.228247538@decadent.org.uk>
Date: Sat, 10 Aug 2019 21:40:07 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, Denis Kirjanov <kda@...ux-powerpc.org>,
"Bartosz Golaszewski" <bgolaszewski@...libre.com>,
"Axel Lin" <axel.lin@...ics.com>,
"Thierry Reding" <thierry.reding@...il.com>
Subject: [PATCH 3.16 041/157] gpio: adnp: Fix testing wrong value in
adnp_gpio_direction_input
3.16.72-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Axel Lin <axel.lin@...ics.com>
commit c5bc6e526d3f217ed2cc3681d256dc4a2af4cc2b upstream.
Current code test wrong value so it does not verify if the written
data is correctly read back. Fix it.
Also make it return -EPERM if read value does not match written bit,
just like it done for adnp_gpio_direction_output().
Fixes: 5e969a401a01 ("gpio: Add Avionic Design N-bit GPIO expander support")
Signed-off-by: Axel Lin <axel.lin@...ics.com>
Reviewed-by: Thierry Reding <thierry.reding@...il.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
drivers/gpio/gpio-adnp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/gpio/gpio-adnp.c
+++ b/drivers/gpio/gpio-adnp.c
@@ -140,8 +140,10 @@ static int adnp_gpio_direction_input(str
if (err < 0)
goto out;
- if (err & BIT(pos))
- err = -EACCES;
+ if (value & BIT(pos)) {
+ err = -EPERM;
+ goto out;
+ }
err = 0;
Powered by blists - more mailing lists