[ALSA] usbaudio - Coping with short replies in usbmixer
authorThomas Reitmayr <thomas@devbase.at>
Tue, 15 May 2007 09:47:48 +0000 (11:47 +0200)
committerJaroslav Kysela <perex@suse.cz>
Wed, 16 May 2007 10:23:20 +0000 (12:23 +0200)
This patch makes sure that short USB replies are treated as an
error when requesting the value of a certain mixer control.

Signed-off-by: Thomas Reitmayr <thomas@devbase.at>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/usb/usbmixer.c

index 7b3bf35..325d4b6 100644 (file)
@@ -360,7 +360,7 @@ static int get_ctl_value(struct usb_mixer_elem_info *cval, int request, int vali
                                    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;
                }