Skip to content

Commit 061b39f

Browse files
fengidrimstsirkin
authored andcommitted
virtio_pci: fix the common cfg map size
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: [email protected] Fixes: 0b50cec ("virtio_pci: introduce helper to get/set queue reset") Signed-off-by: Xuan Zhuo <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]>
1 parent fa2e694 commit 061b39f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/virtio/virtio_pci_modern_dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ int vp_modern_probe(struct virtio_pci_modern_device *mdev)
291291
err = -EINVAL;
292292
mdev->common = vp_modern_map_capability(mdev, common,
293293
sizeof(struct virtio_pci_common_cfg), 4,
294-
0, sizeof(struct virtio_pci_common_cfg),
294+
0, sizeof(struct virtio_pci_modern_common_cfg),
295295
NULL, NULL);
296296
if (!mdev->common)
297297
goto err_map_common;

0 commit comments

Comments
 (0)