]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 15:49:02 +0000 (16:49 +0100)
commitedea36e516324affd97dfc6d32960da59ce2130f
treee36de8e10d9260dfc6ebf3afe4f34e6cff47ba5f
parent38109496f3392c419b023554e8fdb621c695e2ea
ALSA: usb-audio: Fix incorrect NULL check in create_yamaha_midi_quirk()

commit cc9dbfa9707868fb0ca864c05e0c42d3f4d15cf2 upstream.

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