ALSA: usx2y: Fix potential NULL dereference
authorTakashi Iwai <tiwai@suse.de>
Mon, 20 Apr 2020 07:55:29 +0000 (09:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 May 2020 15:23:11 +0000 (17:23 +0200)
commit7a89acb13fdaf59ae75f81d5a5a5dfd2768557dc
treeec0f87ae9a050216691fe0be41f3d8f1c1429947
parentf8e84d7a9417e84aad03b98dbbb0ef44f2adcf3b
ALSA: usx2y: Fix potential NULL dereference

commit 7686e3485253635c529cdd5f416fc640abaf076f upstream.

The error handling code in usX2Y_rate_set() may hit a potential NULL
dereference when an error occurs before allocating all us->urb[].
Add a proper NULL check for fixing the corner case.

Reported-by: Lin Yi <teroincn@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200420075529.27203-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/usx2y/usbusx2yaudio.c