]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ALSA: line6: Fix memory leak at line6_init_pcm() error path
authorTakashi Iwai <tiwai@suse.de>
Wed, 21 Aug 2019 18:00:02 +0000 (20:00 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 26 Sep 2019 04:34:52 +0000 (00:34 -0400)
commit415a4c4e38ca7d33fefcc47ee3b11bc229d3afb9
tree4b073849cf051b14abb653df06d9b8e48095ef8d
parent7b9779cca93cdff1c202882d0ea7f673da2dd4f0
ALSA: line6: Fix memory leak at line6_init_pcm() error path

BugLink: https://bugs.launchpad.net/bugs/1843338
commit 1bc8d18c75fef3b478dbdfef722aae09e2a9fde7 upstream.

I forgot to release the allocated object at the early error path in
line6_init_pcm().  For addressing it, slightly shuffle the code so
that the PCM destructor (pcm->private_free) is assigned properly
before all error paths.

Fixes: 3450121997ce ("ALSA: line6: Fix write on zero-sized buffer")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
sound/usb/line6/pcm.c