Re: [syzbot] [sound?] general protection fault in snd_scarlett2_init
From: Edward Adam Davis
Date: Mon Mar 09 2026 - 02:56:23 EST
#syz test
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index ac8c71ba9483..bd28caec3004 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -3563,8 +3563,12 @@ static int snd_usb_mixer_status_create(struct usb_mixer_interface *mixer)
int buffer_length;
unsigned int epnum;
+ epnum = get_iface_desc(mixer->hostif)->bNumEndpoints;
+ if (epnum == 0)
+ return -EINVAL;
+
/* we need one interrupt input endpoint */
- if (get_iface_desc(mixer->hostif)->bNumEndpoints < 1)
+ if (epnum < 1)
return 0;
ep = get_endpoint(mixer->hostif, 0);
if (!usb_endpoint_dir_in(ep) || !usb_endpoint_xfer_int(ep))