diff options
-rw-r--r-- | drivers/virtio/virtio_vdpa.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |