diff options
author | Gal Pressman <gal@nvidia.com> | 2023-07-26 21:10:07 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-08-10 21:24:28 +0200 |
commit | df9557046440b0a62250fee3169a8f6a139f55a6 (patch) | |
tree | 31235a71bb258724aeea97bf7ca7cd7bb7371a50 /drivers/virtio | |
parent | vduse: Use proper spinlock for IRQ injection (diff) | |
download | linux-df9557046440b0a62250fee3169a8f6a139f55a6.tar.xz linux-df9557046440b0a62250fee3169a8f6a139f55a6.zip |
virtio-vdpa: Fix cpumask memory leak in virtio_vdpa_find_vqs()
Free the cpumask allocated by create_affinity_masks() before returning
from the function.
Fixes: 3dad56823b53 ("virtio-vdpa: Support interrupt affinity spreading mechanism")
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Message-Id: <20230726191036.14324-1-dtatulea@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Xie Yongji <xieyongji@bytedance.com>
Diffstat (limited to 'drivers/virtio')
-rw-r--r-- | drivers/virtio/virtio_vdpa.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c index 989e2d7184ce..961161da5900 100644 --- a/drivers/virtio/virtio_vdpa.c +++ b/drivers/virtio/virtio_vdpa.c @@ -393,11 +393,13 @@ static int virtio_vdpa_find_vqs(struct virtio_device *vdev, unsigned int nvqs, cb.callback = virtio_vdpa_config_cb; cb.private = vd_dev; ops->set_config_cb(vdpa, &cb); + kfree(masks); return 0; err_setup_vq: virtio_vdpa_del_vqs(vdev); + kfree(masks); return err; } |