ALSA: usb-audio: add Microsoft HD-5001 to quirks
[firefly-linux-kernel-4.4.55.git] / sound / usb / clock.c
index 2ed260b10f6dc02cd129550ba1067c878034cb07..7ccbcaf6a1476423e0d2becf0bf91f3463a47b46 100644 (file)
@@ -285,6 +285,8 @@ static int set_sample_rate_v1(struct snd_usb_audio *chip, int iface,
        unsigned char data[3];
        int err, crate;
 
+       if (get_iface_desc(alts)->bNumEndpoints < 1)
+               return -EINVAL;
        ep = get_endpoint(alts, 0)->bEndpointAddress;
 
        /* if endpoint doesn't have sampling rate control, bail out */