projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b99ddbe
)
um: virtio_uml: free command if adding to virtqueue failed
author
Benjamin Berg
<benjamin.berg@intel.com>
Thu, 9 Feb 2023 09:00:02 +0000
(10:00 +0100)
committer
Richard Weinberger
<richard@nod.at>
Mon, 13 Feb 2023 09:14:32 +0000
(10:14 +0100)
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>
arch/um/drivers/virt-pci.c
patch
|
blob
|
history
diff --git
a/arch/um/drivers/virt-pci.c
b/arch/um/drivers/virt-pci.c
index 2ba89347053ac44fe6a108038656a86bbe264585..035c97aadb380ecde6682670414e1754854212f6 100644
(file)
--- a/
arch/um/drivers/virt-pci.c
+++ b/
arch/um/drivers/virt-pci.c
@@
-137,8
+137,11
@@
static int um_pci_send_cmd(struct um_pci_device *dev,
out ? 1 : 0,
posted ? cmd : HANDLE_NO_FREE(cmd),
GFP_ATOMIC);
- if (ret)
+ if (ret) {
+ if (posted)
+ kfree(cmd);
goto out;
+ }
if (posted) {
virtqueue_kick(dev->cmd_vq);