]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: Fix NULL dererence at error path
authorTakashi Iwai <tiwai@suse.de>
Fri, 30 Sep 2022 10:01:29 +0000 (12:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:22:10 +0000 (13:22 +0200)
commitf914cb38963f639fbdb7e690d3c9e18d61a0d380
treedb756390d5f845284df514e8cb006ec826d9274f
parent847559756e243abbdcb81f98d49997e7039b3d18
ALSA: usb-audio: Fix NULL dererence at error path

commit 230f5de249debf98955270853a664250d5792ba5 upstream.

At an error path to release URB buffers and contexts, the driver might
hit a NULL dererence for u->urb pointer, when u->buffer_size has been
already set but the actual URB allocation failed.

Fix it by adding the NULL check of urb.  Also, make sure that
buffer_size is cleared after the error path or the close.

Cc: <stable@vger.kernel.org>
Reported-by: Sabri N. Ferreiro <snferreiro1@gmail.com>
Link: https://lore.kernel.org/r/CAKG+3NRjTey+fFfUEGwuxL-pi_=T4cUskYG9OzpzHytF+tzYng@mail.gmail.com
Link: https://lore.kernel.org/r/20220930100129.19445-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/endpoint.c