Skip to contentSkip to conversation

Coping with short replies in usbmixer

PATCH Thomas Reitmayr 2 participants 2 messages May 14, 2007 – May 15, 2007 Sound

lore
Share & tools
lore
#0 lore raw

Hi,
here is it again and signed off.

This patch makes sure that short USB replies are treated as an error when requesting the value of a certain mixer control.

---

 sound/usb/usbmixer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/usbmixer.c +1 -1
diff -rup a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
@@ -360,7 +360,7 @@ static int get_ctl_value(struct usb_mixe
 				    request,
 				    USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN,
 				    validx, cval->mixer->ctrlif | (cval->id << 8),
-				    buf, val_len, 100) >= 0) {
+				    buf, val_len, 100) >= val_len) {
 			*value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len));
 			return 0;
 		}
#1 lore raw

At Mon, 14 May 2007 19:54:34 +0200,

Quoted 8 lines · Thomas Reitmayr

Hi,
here is it again and signed off.

This patch makes sure that short USB replies are treated as an error when requesting the value of a certain mixer control.

Thanks, now applied to ALSA tree.

Takashi