diff options
author | Douglas Schilling Landgraf <dougsland@redhat.com> | 2009-02-05 10:00:03 -0200 |
---|---|---|
committer | Douglas Schilling Landgraf <dougsland@redhat.com> | 2009-02-05 10:00:03 -0200 |
commit | 2b47bb2b85cbd75eff389304c2b55bebecfb4755 (patch) | |
tree | 5e04ab20e6c22688b06ab9171bd58e16c7c680dd /linux/drivers/media/radio | |
parent | bf126270efecf5e5531fa1972fc1e9b4b297f835 (diff) | |
download | mediapointer-dvb-s2-2b47bb2b85cbd75eff389304c2b55bebecfb4755.tar.gz mediapointer-dvb-s2-2b47bb2b85cbd75eff389304c2b55bebecfb4755.tar.bz2 |
radio-mr800: fix checking of retval after usb_bulk_msg
From: Alexey Klimov <klimov.linux@gmail.com>
Patch corrects checking of returned value after usb_bulk_msg. Now we
also check if number of transferred bytes equals to BUFFER_LENGTH.
Priority: normal
Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Diffstat (limited to 'linux/drivers/media/radio')
-rw-r--r-- | linux/drivers/media/radio/radio-mr800.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/linux/drivers/media/radio/radio-mr800.c b/linux/drivers/media/radio/radio-mr800.c index 60c8c19fc..c04c8887e 100644 --- a/linux/drivers/media/radio/radio-mr800.c +++ b/linux/drivers/media/radio/radio-mr800.c @@ -217,7 +217,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; } @@ -254,7 +254,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; } @@ -271,7 +271,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; } |