mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 15:47:36 +00:00
virtio_pci: modify ENOENT to EINVAL
[ Upstream commit b66ead2d0e
]
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 <angus.chen@jaguarmicro.com>
Message-Id: <20221101111655.1947-1-angus.chen@jaguarmicro.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
af3fca732e
commit
ab23a6dbfc
1 changed files with 1 additions and 1 deletions
|
@ -303,7 +303,7 @@ static struct virtqueue *setup_vq(struct virtio_pci_device *vp_dev,
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (index >= vp_modern_get_num_queues(mdev))
|
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. */
|
/* Check if queue is either not available or already active. */
|
||||||
num = vp_modern_get_queue_size(mdev, index);
|
num = vp_modern_get_queue_size(mdev, index);
|
||||||
|
|
Loading…
Reference in a new issue