diff options
Diffstat (limited to 'drivers/media/radio')
-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 | } |