virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio-vdpa: Fix unchecked call to NULL set_vq_affinity
@ 2023-05-04 13:50 Dragos Tatulea via Virtualization
  2023-05-04 17:08 ` Feng Liu via Virtualization
  2023-05-04 17:47 ` Feng Liu via Virtualization
  0 siblings, 2 replies; 11+ messages in thread
From: Dragos Tatulea via Virtualization @ 2023-05-04 13:50 UTC (permalink / raw)
  To: Michael S. Tsirkin, Jason Wang, Xuan Zhuo, Xie Yongji
  Cc: linux-kernel, Gal Pressman, virtualization

The referenced patch calls set_vq_affinity without checking if the op is
valid. This patch adds the check.

Fixes: 3dad56823b53 ("virtio-vdpa: Support interrupt affinity spreading mechanism")
Reviewed-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
---
 drivers/virtio/virtio_vdpa.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c
index eb6aee8c06b2..989e2d7184ce 100644
--- a/drivers/virtio/virtio_vdpa.c
+++ b/drivers/virtio/virtio_vdpa.c
@@ -385,7 +385,9 @@ static int virtio_vdpa_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
 			err = PTR_ERR(vqs[i]);
 			goto err_setup_vq;
 		}
-		ops->set_vq_affinity(vdpa, i, &masks[i]);
+
+		if (ops->set_vq_affinity)
+			ops->set_vq_affinity(vdpa, i, &masks[i]);
 	}
 
 	cb.callback = virtio_vdpa_config_cb;
-- 
2.40.1

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

end of thread, other threads:[~2023-06-02 12:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-04 13:50 [PATCH] virtio-vdpa: Fix unchecked call to NULL set_vq_affinity Dragos Tatulea via Virtualization
2023-05-04 17:08 ` Feng Liu via Virtualization
2023-05-04 17:19   ` Dragos Tatulea via Virtualization
2023-05-04 17:46     ` Feng Liu via Virtualization
2023-05-04 18:51   ` Michael S. Tsirkin
2023-05-04 22:47     ` Feng Liu via Virtualization
2023-05-12 12:51     ` Dragos Tatulea
2023-05-12 13:30       ` Michael S. Tsirkin
2023-05-12 23:55         ` Shannon Nelson via Virtualization
2023-06-02 12:21           ` Michael S. Tsirkin
2023-05-04 17:47 ` Feng Liu via Virtualization

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).