diff options
author | Maximilian Heyne <mheyne@amazon.de> | 2023-09-11 09:03:29 +0000 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-10-18 11:29:09 -0400 |
commit | fab7f259227b8f70aa6d54e1de1a1f5f4729041c (patch) | |
tree | b3cbe73151ec3f9d6193b64680887d0a13e03bab /fs/ioctl.c | |
parent | d121df789b159e9a8ee770666f210975a81e8111 (diff) |
virtio-mmio: fix memory leak of vm_dev
With the recent removal of vm_dev from devres its memory is only freed
via the callback virtio_mmio_release_dev. However, this only takes
effect after device_add is called by register_virtio_device. Until then
it's an unmanaged resource and must be explicitly freed on error exit.
This bug was discovered and resolved using Coverity Static Analysis
Security Testing (SAST) by Synopsys, Inc.
Cc: stable@vger.kernel.org
Fixes: 55c91fedd03d ("virtio-mmio: don't break lifecycle of vm_dev")
Signed-off-by: Maximilian Heyne <mheyne@amazon.de>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Message-Id: <20230911090328.40538-1-mheyne@amazon.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Diffstat (limited to 'fs/ioctl.c')
0 files changed, 0 insertions, 0 deletions