Commit e57458dc authored by Alexey Klimov's avatar Alexey Klimov Committed by Mauro Carvalho Chehab

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: default avatarAlexey Klimov <klimov.linux@gmail.com>
Signed-off-by: default avatarDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 71f07d94
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment