diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-07 12:50:21 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-14 11:52:25 -0400 |
commit | e2296021081584bd6f0e2ea21e8b909c1d4b5a07 (patch) | |
tree | 550e622ed8d91050b3015c203f4b08901aee50a4 | |
parent | 88ca3619001380a3147246a22cb356f6065ad713 (diff) |
[media] nova-t-usb2: 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>
-rw-r--r-- | drivers/media/usb/dvb-usb/nova-t-usb2.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/media/usb/dvb-usb/nova-t-usb2.c b/drivers/media/usb/dvb-usb/nova-t-usb2.c index 26d7188a1163..1babd3341910 100644 --- a/drivers/media/usb/dvb-usb/nova-t-usb2.c +++ b/drivers/media/usb/dvb-usb/nova-t-usb2.c | |||
@@ -76,7 +76,7 @@ static int nova_t_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
76 | { | 76 | { |
77 | u8 *buf, data, toggle, custom; | 77 | u8 *buf, data, toggle, custom; |
78 | u16 raw; | 78 | u16 raw; |
79 | int i; | 79 | int i, ret; |
80 | struct dibusb_device_state *st = d->priv; | 80 | struct dibusb_device_state *st = d->priv; |
81 | 81 | ||
82 | buf = kmalloc(5, GFP_KERNEL); | 82 | buf = kmalloc(5, GFP_KERNEL); |
@@ -85,7 +85,9 @@ static int nova_t_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
85 | 85 | ||
86 | buf[0] = DIBUSB_REQ_POLL_REMOTE; | 86 | buf[0] = DIBUSB_REQ_POLL_REMOTE; |
87 | buf[1] = 0x35; | 87 | buf[1] = 0x35; |
88 | dvb_usb_generic_rw(d, buf, 2, buf, 5, 0); | 88 | ret = dvb_usb_generic_rw(d, buf, 2, buf, 5, 0); |
89 | if (ret < 0) | ||
90 | goto ret; | ||
89 | 91 | ||
90 | *state = REMOTE_NO_KEY_PRESSED; | 92 | *state = REMOTE_NO_KEY_PRESSED; |
91 | switch (buf[0]) { | 93 | switch (buf[0]) { |
@@ -124,8 +126,9 @@ static int nova_t_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
124 | break; | 126 | break; |
125 | } | 127 | } |
126 | 128 | ||
129 | ret: | ||
127 | kfree(buf); | 130 | kfree(buf); |
128 | return 0; | 131 | return ret; |
129 | } | 132 | } |
130 | 133 | ||
131 | static int nova_t_read_mac_address (struct dvb_usb_device *d, u8 mac[6]) | 134 | static int nova_t_read_mac_address (struct dvb_usb_device *d, u8 mac[6]) |