diff options
author | Suman Anna <[email protected]> | 2020-02-24 15:26:43 -0600 |
---|---|---|
committer | Michael S. Tsirkin <[email protected]> | 2020-03-08 05:35:23 -0400 |
commit | f13f09a12cbd0c7b776e083c5d008b6c6a9c4e0b (patch) | |
tree | d5d6a5dc5f4df13d7a1bdae3a79176f6d772fae3 /tools/perf/scripts/python/failed-syscalls-by-pid.py | |
parent | 98d54f81e36ba3bf92172791eba5ca5bd813989b (diff) |
virtio_ring: Fix mem leak with vring_new_virtqueue()
The functions vring_new_virtqueue() and __vring_new_virtqueue() are used
with split rings, and any allocations within these functions are managed
outside of the .we_own_ring flag. The commit cbeedb72b97a ("virtio_ring:
allocate desc state for split ring separately") allocates the desc state
within the __vring_new_virtqueue() but frees it only when the .we_own_ring
flag is set. This leads to a memory leak when freeing such allocated
virtqueues with the vring_del_virtqueue() function.
Fix this by moving the desc_state free code outside the flag and only
for split rings. Issue was discovered during testing with remoteproc
and virtio_rpmsg.
Fixes: cbeedb72b97a ("virtio_ring: allocate desc state for split ring separately")
Signed-off-by: Suman Anna <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/failed-syscalls-by-pid.py')
0 files changed, 0 insertions, 0 deletions