mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
virtio-vdpa: Fix unchecked call to NULL set_vq_affinity
The referenced patch calls set_vq_affinity without checking if the op is
valid. This patch adds the check.
Fixes: 3dad56823b
("virtio-vdpa: Support interrupt affinity spreading mechanism")
Reviewed-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Message-Id: <20230504135053.2283816-1-dtatulea@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Feng Liu <feliu@nvidia.com>
This commit is contained in:
parent
ef9da01c12
commit
fe37efba47
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user