diff mbox series

input: sentelic: fix error return when fsp_reg_write fails

Message ID 20200603141218.131663-1-colin.king@canonical.com
State Accepted
Commit ea38f06e0291986eb93beb6d61fd413607a30ca4
Headers show
Series input: sentelic: fix error return when fsp_reg_write fails | expand

Commit Message

Colin King June 3, 2020, 2:12 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Currently when the call to fsp_reg_write fails -EIO is not being returned
because the count is being returned instead of the return value in retval.
Fix this by returning the value in retval instead of count.

Addresses-Coverity: ("Unused value")
Fixes: fc69f4a6af49 ("Input: add new driver for Sentelic Finger Sensing Pad")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/input/mouse/sentelic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dmitry Torokhov Aug. 6, 2020, 10:36 p.m. UTC | #1
On Wed, Jun 03, 2020 at 03:12:18PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>

> 

> Currently when the call to fsp_reg_write fails -EIO is not being returned

> because the count is being returned instead of the return value in retval.

> Fix this by returning the value in retval instead of count.

> 

> Addresses-Coverity: ("Unused value")

> Fixes: fc69f4a6af49 ("Input: add new driver for Sentelic Finger Sensing Pad")

> Signed-off-by: Colin Ian King <colin.king@canonical.com>


Applied, thank you.

-- 
Dmitry
diff mbox series

Patch

diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c
index e99d9bf1a267..e78c4c7eda34 100644
--- a/drivers/input/mouse/sentelic.c
+++ b/drivers/input/mouse/sentelic.c
@@ -441,7 +441,7 @@  static ssize_t fsp_attr_set_setreg(struct psmouse *psmouse, void *data,
 
 	fsp_reg_write_enable(psmouse, false);
 
-	return count;
+	return retval;
 }
 
 PSMOUSE_DEFINE_WO_ATTR(setreg, S_IWUSR, NULL, fsp_attr_set_setreg);