diff options
author | Alexey Klimov <klimov.linux@gmail.com> | 2009-02-05 07:00:03 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:40 -0400 |
commit | e57458dc7086bac9e05b6fc6d5ab336de1647c12 (patch) | |
tree | 2517fe5d8f2662e2585e5752f42958d10778ee2b /drivers/media/radio/radio-mr800.c | |
parent | 71f07d94ce26f80381acf90cc222eb683ffcc8f3 (diff) |
V4L/DVB (10463): radio-mr800: fix checking of retval after usb_bulk_msg
Patch corrects checking of returned value after usb_bulk_msg. Now we
also check if number of transferred bytes equals to BUFFER_LENGTH.
Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio/radio-mr800.c')
-rw-r--r-- | drivers/media/radio/radio-mr800.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index 23c3c539157b..ded25bfb366e 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c | |||
@@ -214,7 +214,7 @@ static int amradio_set_mute(struct amradio_device *radio, char argument) | |||
214 | retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2), | 214 | retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2), |
215 | (void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT); | 215 | (void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT); |
216 | 216 | ||
217 | if (retval) { | 217 | if (retval < 0 || size != BUFFER_LENGTH) { |
218 | mutex_unlock(&radio->lock); | 218 | mutex_unlock(&radio->lock); |
219 | return retval; | 219 | return retval; |
220 | } | 220 | } |
@@ -251,7 +251,7 @@ static int amradio_setfreq(struct amradio_device *radio, int freq) | |||
251 | retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2), | 251 | retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2), |
252 | (void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT); | 252 | (void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT); |
253 | 253 | ||
254 | if (retval) { | 254 | if (retval < 0 || size != BUFFER_LENGTH) { |
255 | mutex_unlock(&radio->lock); | 255 | mutex_unlock(&radio->lock); |
256 | return retval; | 256 | return retval; |
257 | } | 257 | } |
@@ -268,7 +268,7 @@ static int amradio_setfreq(struct amradio_device *radio, int freq) | |||
268 | retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2), | 268 | retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2), |
269 | (void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT); | 269 | (void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT); |
270 | 270 | ||
271 | if (retval) { | 271 | if (retval < 0 || size != BUFFER_LENGTH) { |
272 | mutex_unlock(&radio->lock); | 272 | mutex_unlock(&radio->lock); |
273 | return retval; | 273 | return retval; |
274 | } | 274 | } |