mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] virtio-vdpa: Fix cpumask memory leak in virtio_vdpa_find_vqs()
@ 2023-07-26 19:10 Dragos Tatulea
  2023-07-27  6:09 ` Jason Wang
  2023-07-31  2:23 ` Yongji Xie
  0 siblings, 2 replies; 3+ messages in thread
From: Dragos Tatulea @ 2023-07-26 19:10 UTC (permalink / raw)
  To: Michael S. Tsirkin, Jason Wang, Xuan Zhuo, Xie Yongji
  Cc: stable, Gal Pressman, Dragos Tatulea, virtualization, linux-kernel

From: Gal Pressman <gal@nvidia.com>

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>
---
 drivers/virtio/virtio_vdpa.c | 2 ++
 1 file changed, 2 insertions(+)

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;
 }
 
-- 
2.41.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] virtio-vdpa: Fix cpumask memory leak in virtio_vdpa_find_vqs()
  2023-07-26 19:10 [PATCH] virtio-vdpa: Fix cpumask memory leak in virtio_vdpa_find_vqs() Dragos Tatulea
@ 2023-07-27  6:09 ` Jason Wang
  2023-07-31  2:23 ` Yongji Xie
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Wang @ 2023-07-27  6:09 UTC (permalink / raw)
  To: Dragos Tatulea
  Cc: Michael S. Tsirkin, Xuan Zhuo, Xie Yongji, stable, Gal Pressman,
	virtualization, linux-kernel

On Thu, Jul 27, 2023 at 3:11 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
>
> From: Gal Pressman <gal@nvidia.com>
>
> 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>

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks

> ---
>  drivers/virtio/virtio_vdpa.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> 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;
>  }
>
> --
> 2.41.0
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] virtio-vdpa: Fix cpumask memory leak in virtio_vdpa_find_vqs()
  2023-07-26 19:10 [PATCH] virtio-vdpa: Fix cpumask memory leak in virtio_vdpa_find_vqs() Dragos Tatulea
  2023-07-27  6:09 ` Jason Wang
@ 2023-07-31  2:23 ` Yongji Xie
  1 sibling, 0 replies; 3+ messages in thread
From: Yongji Xie @ 2023-07-31  2:23 UTC (permalink / raw)
  To: Dragos Tatulea
  Cc: Michael S. Tsirkin, Jason Wang, Xuan Zhuo, stable, Gal Pressman,
	virtualization, linux-kernel

On Thu, Jul 27, 2023 at 3:11 AM Dragos Tatulea <dtatulea@nvidia.com> wrote:
>
> From: Gal Pressman <gal@nvidia.com>
>
> 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>

Reviewed-by: Xie Yongji <xieyongji@bytedance.com>

Thanks,
Yongji

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-31  2:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-26 19:10 [PATCH] virtio-vdpa: Fix cpumask memory leak in virtio_vdpa_find_vqs() Dragos Tatulea
2023-07-27  6:09 ` Jason Wang
2023-07-31  2:23 ` Yongji Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®