diff mbox series

[2/4] Platform: OLPC: Fix olpc_xo175_ec_cmd() return value

Message ID 20190529083405.332762-3-lkundrak@v3.sk (mailing list archive)
State Accepted, archived
Headers show
Series [1/4] Platform: OLPC: Make olpc_dt_compatible_match() static __init | expand

Commit Message

Lubomir Rintel May 29, 2019, 8:34 a.m. UTC
Reset the ret variable to make sure it olpc_xo175_ec_cmd() ends up
returning zero on success.

Fixes: commit 0c3d931b3ab9 ("Platform: OLPC: Add XO-1.75 EC driver")
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 drivers/platform/olpc/olpc-xo175-ec.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/platform/olpc/olpc-xo175-ec.c b/drivers/platform/olpc/olpc-xo175-ec.c
index 344d14f3da54..48d6f0d87583 100644
--- a/drivers/platform/olpc/olpc-xo175-ec.c
+++ b/drivers/platform/olpc/olpc-xo175-ec.c
@@ -507,6 +507,7 @@  static int olpc_xo175_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *resp,
 		nr_bytes = resp_len;
 	} else {
 		nr_bytes = (size_t)ret;
+		ret = 0;
 	}
 	resp_len = min(resp_len, nr_bytes);