Commit df955704 authored by Gal Pressman's avatar Gal Pressman Committed by Michael S. Tsirkin

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: 3dad5682 ("virtio-vdpa: Support interrupt affinity spreading mechanism")
Signed-off-by: default avatarGal Pressman <gal@nvidia.com>
Reviewed-by: default avatarDragos Tatulea <dtatulea@nvidia.com>
Message-Id: <20230726191036.14324-1-dtatulea@nvidia.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Reviewed-by: default avatarXie Yongji <xieyongji@bytedance.com>
parent 7ca26efb
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment