summaryrefslogtreecommitdiffstats
path: root/kernel/sound/usb/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sound/usb/clock.c')
-rw-r--r--kernel/sound/usb/clock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sound/usb/clock.c b/kernel/sound/usb/clock.c
index 2ed260b10..7ccbcaf6a 100644
--- a/kernel/sound/usb/clock.c
+++ b/kernel/sound/usb/clock.c
@@ -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 */