aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngus Chen <[email protected]>2022-11-01 19:16:54 +0800
committerMichael S. Tsirkin <[email protected]>2022-12-28 05:28:09 -0500
commitb66ead2d0ecac00c3a06a6218af5411cb5fcb5d5 (patch)
tree8c06e43be20ab94bab2d49bb9671b085d919c805
parenta9f0a19ff7700cc8a30db2496f40d18490dcb9df (diff)
virtio_pci: modify ENOENT to EINVAL
Virtio_crypto use max_data_queues+1 to setup vqs, we use vp_modern_get_num_queues to protect the vq range in setup_vq. We could enter index >= vp_modern_get_num_queues(mdev) in setup_vq if common->num_queues is not set well,and it return -ENOENT. It is better to use -EINVAL instead. Signed-off-by: Angus Chen <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
-rw-r--r--drivers/virtio/virtio_pci_modern.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
index 207294bd7b9d..9e496e288cfa 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -303,7 +303,7 @@ static struct virtqueue *setup_vq(struct virtio_pci_device *vp_dev,
int err;
if (index >= vp_modern_get_num_queues(mdev))
- return ERR_PTR(-ENOENT);
+ return ERR_PTR(-EINVAL);
/* Check if queue is either not available or already active. */
num = vp_modern_get_queue_size(mdev, index);