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>
Wed, 29 Apr 2020 14:34:46 +0000 (16:34 +0200)
commita93b23a19ff9922b60daf4476f7b1f8c1e867417
tree912f0363311f5db7b3ef62a7b8a50713ae24efae
parent1b9862583ed11ca937fd0f7d97cc797d4196c064
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