mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
um: virtio_uml: free command if adding to virtqueue failed
[ Upstream commit8a6ca54364
] 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:68f5d3f3b6
("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>
This commit is contained in:
parent
8ba6b0fade
commit
1b1ef45d48
1 changed files with 4 additions and 1 deletions
|
@ -131,8 +131,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);
|
||||
|
|
Loading…
Reference in a new issue