You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open()
commit ad72c3c3f6 upstream.
snd_usbmidi_output_open() has a check of the NULL port with
snd_BUG_ON(). snd_BUG_ON() was used as this shouldn't have happened,
but in reality, the NULL port may be seen when the device gives an
invalid endpoint setup at the descriptor, hence the driver skips the
allocation. That is, the check itself is valid and snd_BUG_ON()
should be dropped from there. Otherwise it's confusing as if it were
a real bug, as recently syzbot stumbled on it.
Reported-by: syzbot+9abda841d636d86c41da@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/syzbot+9abda841d636d86c41da@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20221112141223.6144-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
28a54854a9
commit
a80369c8ca
@@ -1149,10 +1149,8 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
|
||||
port = &umidi->endpoints[i].out->ports[j];
|
||||
break;
|
||||
}
|
||||
if (!port) {
|
||||
snd_BUG();
|
||||
if (!port)
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
substream->runtime->private_data = port;
|
||||
port->state = STATE_UNKNOWN;
|
||||
|
||||
Reference in New Issue
Block a user