Commit ff1c1235 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[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: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 426398b1
...@@ -366,6 +366,7 @@ EXPORT_SYMBOL(rc_map_dibusb_table); ...@@ -366,6 +366,7 @@ EXPORT_SYMBOL(rc_map_dibusb_table);
int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state) int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
{ {
u8 *buf; u8 *buf;
int ret;
buf = kmalloc(5, GFP_KERNEL); buf = kmalloc(5, GFP_KERNEL);
if (!buf) if (!buf)
...@@ -373,7 +374,9 @@ int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state) ...@@ -373,7 +374,9 @@ int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
buf[0] = DIBUSB_REQ_POLL_REMOTE; 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); 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) ...@@ -382,6 +385,7 @@ int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
kfree(buf); kfree(buf);
return 0; ret:
return ret;
} }
EXPORT_SYMBOL(dibusb_rc_query); EXPORT_SYMBOL(dibusb_rc_query);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment