virt: acrn: fix a memory leak in acrn_dev_ioctl()
authorXiaolong Huang <butterflyhuangxx@gmail.com>
Tue, 8 Mar 2022 09:20:47 +0000 (17:20 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Mar 2022 12:49:59 +0000 (13:49 +0100)
commitecd1735f14d6ac868ae5d8b7a2bf193fa11f388b
tree9b8d6a6bf59037b8141f8f3692563842b99de613
parent8a6e85f75a83d16a71077e41f2720c691f432002
virt: acrn: fix a memory leak in acrn_dev_ioctl()

The vm_param and cpu_regs need to be freed via kfree()
before return -EINVAL error.

Fixes: 9c5137aedd11 ("virt: acrn: Introduce VM management interfaces")
Fixes: 2ad2aaee1bc9 ("virt: acrn: Introduce an ioctl to set vCPU registers state")
Signed-off-by: Xiaolong Huang <butterflyhuangxx@gmail.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
Link: https://lore.kernel.org/r/20220308092047.1008409-1-butterflyhuangxx@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/virt/acrn/hsm.c