mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
ALSA: usb-audio: Fix incorrect NULL check in create_yamaha_midi_quirk()
commitcc9dbfa970
upstream. The commit60849562a5
("ALSA: usb-audio: Fix possible NULL dereference at create_yamaha_midi_quirk()") added NULL checks in create_yamaha_midi_quirk(), but there was an overlook. The code allows one of either injd or outjd is NULL, but the second if check made returning -ENODEV if any of them is NULL. Fix it in a proper form. Fixes:60849562a5
("ALSA: usb-audio: Fix possible NULL dereference at create_yamaha_midi_quirk()") Reported-by: Pavel Machek <pavel@denx.de> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20191113111259.24123-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:
parent
ab2ee4299b
commit
420433f6cf
1 changed files with 2 additions and 2 deletions
|
@ -259,8 +259,8 @@ static int create_yamaha_midi_quirk(struct snd_usb_audio *chip,
|
|||
NULL, USB_MS_MIDI_OUT_JACK);
|
||||
if (!injd && !outjd)
|
||||
return -ENODEV;
|
||||
if (!(injd && snd_usb_validate_midi_desc(injd)) ||
|
||||
!(outjd && snd_usb_validate_midi_desc(outjd)))
|
||||
if ((injd && !snd_usb_validate_midi_desc(injd)) ||
|
||||
(outjd && !snd_usb_validate_midi_desc(outjd)))
|
||||
return -ENODEV;
|
||||
if (injd && (injd->bLength < 5 ||
|
||||
(injd->bJackType != USB_MS_EMBEDDED &&
|
||||
|
|
Loading…
Reference in a new issue