Skip to content

Commit 6e8a914

Browse files
committed
ALSA: line6: Perform sanity check for each URB creation
LINE6 drivers create stream URBs with a fixed pipe without checking its validity, and this may lead to a kernel WARNING at the submission when a malformed USB descriptor is passed. For avoiding the kernel warning, perform the similar sanity checks for each pipe type at creating a URB. Reported-by: [email protected] Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent f79a732 commit 6e8a914

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

sound/usb/line6/capture.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ int line6_create_audio_in_urbs(struct snd_line6_pcm *line6pcm)
286286
urb->interval = LINE6_ISO_INTERVAL;
287287
urb->error_count = 0;
288288
urb->complete = audio_in_callback;
289+
if (usb_urb_ep_type_check(urb))
290+
return -EINVAL;
289291
}
290292

291293
return 0;

sound/usb/line6/playback.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,8 @@ int line6_create_audio_out_urbs(struct snd_line6_pcm *line6pcm)
431431
urb->interval = LINE6_ISO_INTERVAL;
432432
urb->error_count = 0;
433433
urb->complete = audio_out_callback;
434+
if (usb_urb_ep_type_check(urb))
435+
return -EINVAL;
434436
}
435437

436438
return 0;

0 commit comments

Comments
 (0)