summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2018-03-23 07:33:22 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-03-23 07:33:22 -0400
commit728d9fd9f148f03ec0bfa4891a44210a032d9663 (patch)
tree24e682c5d82a5167622c1def984c9dadbff8592c /drivers
parent2be09d8d8342f775a9a6a9da6b91dded0a879718 (diff)
downloadlinux-728d9fd9f148f03ec0bfa4891a44210a032d9663.tar.bz2
media: em28xx-input: improve error handling code
The current I2C error handling logic makes static analyzers confused: drivers/media/usb/em28xx/em28xx-input.c:96 em28xx_get_key_terratec() error: uninitialized symbol 'b'. Change it to match the coding style we're using elsewhere. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/usb/em28xx/em28xx-input.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index eb2ec0384b69..2dc1be00b8b8 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -82,11 +82,16 @@ struct em28xx_IR {
static int em28xx_get_key_terratec(struct i2c_client *i2c_dev,
enum rc_proto *protocol, u32 *scancode)
{
+ int rc;
unsigned char b;
/* poll IR chip */
- if (i2c_master_recv(i2c_dev, &b, 1) != 1)
+ rc = i2c_master_recv(i2c_dev, &b, 1);
+ if (rc != 1) {
+ if (rc < 0)
+ return rc;
return -EIO;
+ }
/*
* it seems that 0xFE indicates that a button is still hold