]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
um: virtio_uml: fix memory leak on init failures
authorJohannes Berg <johannes.berg@intel.com>
Fri, 25 Jun 2021 08:34:37 +0000 (10:34 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 5 Nov 2021 09:19:48 +0000 (10:19 +0100)
commit90cf5b2ef654895f92ef99e8a61e2ccd25a05ac3
treea46010f34cd6dfa5697abcdd6cdc5bc2ab700a7d
parente0b72f0082761321e703fc3a07adb5f63401a158
um: virtio_uml: fix memory leak on init failures

BugLink: https://bugs.launchpad.net/bugs/1949397
commit 7ad28e0df7ee9dbcb793bb88dd81d4d22bb9a10e upstream.

If initialization fails, e.g. because the connection failed,
we leak the 'vu_dev'. Fix that. Reported by smatch.

Fixes: 5d38f324993f ("um: drivers: Add virtio vhost-user driver")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
arch/um/drivers/virtio_uml.c