mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
virtio_pci: fix the common cfg map size
commit061b39fdfeupstream. The function vp_modern_map_capability() takes the size parameter, which corresponds to the size of virtio_pci_common_cfg. As a result, this indicates the size of memory area to map. Now the size is the size of virtio_pci_common_cfg, but some feature(such as the _F_RING_RESET) needs the virtio_pci_modern_common_cfg, so this commit changes the size to the size of virtio_pci_modern_common_cfg. Cc: stable@vger.kernel.org Fixes:0b50cece0b("virtio_pci: introduce helper to get/set queue reset") Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Message-Id: <20231010031120.81272-3-xuanzhuo@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
86f467d358
commit
534487cc3e
@@ -282,7 +282,7 @@ int vp_modern_probe(struct virtio_pci_modern_device *mdev)
|
|||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
mdev->common = vp_modern_map_capability(mdev, common,
|
mdev->common = vp_modern_map_capability(mdev, common,
|
||||||
sizeof(struct virtio_pci_common_cfg), 4,
|
sizeof(struct virtio_pci_common_cfg), 4,
|
||||||
0, sizeof(struct virtio_pci_common_cfg),
|
0, sizeof(struct virtio_pci_modern_common_cfg),
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
if (!mdev->common)
|
if (!mdev->common)
|
||||||
goto err_map_common;
|
goto err_map_common;
|
||||||
|
|||||||
Reference in New Issue
Block a user