summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-07 13:40:48 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-14 12:38:54 -0300
commitff1c123545d706c6e414132c9fc93e345f5141da (patch)
tree3e9d5c0065ad8d4e88bccc56554e5c36fb27c3dc /drivers/media
parent426398b15d9f18ce3e7b5c4e657b4c0103dd8389 (diff)
downloadlinux-ff1c123545d706c6e414132c9fc93e345f5141da.tar.bz2
[media] dibusb: handle error code on RC query
There's no sense on decoding and generating a RC key code if there was an error on the URB control message. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/dvb-usb/dibusb-common.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/usb/dvb-usb/dibusb-common.c b/drivers/media/usb/dvb-usb/dibusb-common.c
index 951f3dac9082..b0fd9a609352 100644
--- a/drivers/media/usb/dvb-usb/dibusb-common.c
+++ b/drivers/media/usb/dvb-usb/dibusb-common.c
@@ -366,6 +366,7 @@ EXPORT_SYMBOL(rc_map_dibusb_table);
int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
{
u8 *buf;
+ int ret;
buf = kmalloc(5, GFP_KERNEL);
if (!buf)
@@ -373,7 +374,9 @@ int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
buf[0] = DIBUSB_REQ_POLL_REMOTE;
- dvb_usb_generic_rw(d, buf, 1, buf, 5, 0);
+ ret = dvb_usb_generic_rw(d, buf, 1, buf, 5, 0);
+ if (ret < 0)
+ goto ret;
dvb_usb_nec_rc_key_to_event(d, buf, event, state);
@@ -382,6 +385,7 @@ int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
kfree(buf);
- return 0;
+ret:
+ return ret;
}
EXPORT_SYMBOL(dibusb_rc_query);