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)
committerDom Cobley <popcornmix@gmail.com>
Thu, 14 Oct 2021 11:33:01 +0000 (12:33 +0100)
commiteffad8857092f13f3bbdb9c5f048f54004ff28e7
tree013cb0c6921b710a81aa68e293fa1bfa6bc63a67
parente325ebbad3cbb2fe235816a552d8b5a09ccd7210
um: virtio_uml: fix memory leak on init failures

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>
arch/um/drivers/virtio_uml.c