]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: Fix incorrect NULL check in create_yamaha_midi_quirk()
authorTakashi Iwai <tiwai@suse.de>
Wed, 13 Nov 2019 11:12:59 +0000 (12:12 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 14 Nov 2019 11:09:06 +0000 (12:09 +0100)
commit7eeb5cbb19bc23e49e529ef3bd513d5d0043ed75
treedac8f56c68b2c1eae9feb51e12c8a37509cf2688
parent0f44c6e61de75571da018872cbd8c4c8a080f579
ALSA: usb-audio: Fix incorrect NULL check in create_yamaha_midi_quirk()

The commit 3495fe1fe91b ("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: 3495fe1fe91b ("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>
sound/usb/quirks.c