um: virtio_uml: free command if adding to virtqueue failed
authorBenjamin Berg <benjamin.berg@intel.com>
Thu, 9 Feb 2023 09:00:02 +0000 (10:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:22 +0000 (13:55 +0100)
commit4e774bf6ea50030dee58598c0fc2697a43409965
tree6e166e6fa12ede068e324ec42deabfc6eae85b2f
parent28ebc1164a45db27261ad8440dcbe9238beaf32a
um: virtio_uml: free command if adding to virtqueue failed

[ Upstream commit 8a6ca543646f2940832665dbf4e04105262505e2 ]

If adding the command fails (i.e. the virtqueue is broken) then free it
again if the function allocated a new buffer for it.

Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/um/drivers/virt-pci.c