summaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-mr800.c
diff options
context:
space:
mode:
authorAlexey Klimov <klimov.linux@gmail.com>2009-02-05 09:00:03 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 12:42:40 -0300
commite57458dc7086bac9e05b6fc6d5ab336de1647c12 (patch)
tree2517fe5d8f2662e2585e5752f42958d10778ee2b /drivers/media/radio/radio-mr800.c
parent71f07d94ce26f80381acf90cc222eb683ffcc8f3 (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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 23c3c539157..ded25bfb366 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)
retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2),
(void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT);
- if (retval) {
+ if (retval < 0 || size != BUFFER_LENGTH) {
mutex_unlock(&radio->lock);
return retval;
}
@@ -251,7 +251,7 @@ static int amradio_setfreq(struct amradio_device *radio, int freq)
retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2),
(void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT);
- if (retval) {
+ if (retval < 0 || size != BUFFER_LENGTH) {
mutex_unlock(&radio->lock);
return retval;
}
@@ -268,7 +268,7 @@ static int amradio_setfreq(struct amradio_device *radio, int freq)
retval = usb_bulk_msg(radio->usbdev, usb_sndintpipe(radio->usbdev, 2),
(void *) (radio->buffer), BUFFER_LENGTH, &size, USB_TIMEOUT);
- if (retval) {
+ if (retval < 0 || size != BUFFER_LENGTH) {
mutex_unlock(&radio->lock);
return retval;
}