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

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


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

end of thread, other threads:[~2023-05-12 13:31 UTC | newest]

Thread overview: 9+ 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
2023-05-04 17:08 ` Feng Liu
2023-05-04 17:19   ` Dragos Tatulea
2023-05-04 17:46     ` Feng Liu
2023-05-04 18:51   ` Michael S. Tsirkin
2023-05-04 22:47     ` Feng Liu
2023-05-12 12:51     ` Dragos Tatulea
2023-05-12 13:30       ` Michael S. Tsirkin
2023-05-04 17:47 ` Feng Liu

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