]> Git Repo - linux.git/commitdiff
virtio_pci: fix the common cfg map size
authorXuan Zhuo <[email protected]>
Tue, 10 Oct 2023 03:11:18 +0000 (11:11 +0800)
committerMichael S. Tsirkin <[email protected]>
Wed, 18 Oct 2023 15:30:12 +0000 (11:30 -0400)
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: 0b50cece0b78 ("virtio_pci: introduce helper to get/set queue reset")
Signed-off-by: Xuan Zhuo <[email protected]>
Message-Id: <20231010031120[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
drivers/virtio/virtio_pci_modern_dev.c

index aad7d9296e772063f8a15757cdf33c0ba1b2fc7d..9cb601e16688dccc8373fef26a604e1ea5766765 100644 (file)
@@ -291,7 +291,7 @@ int vp_modern_probe(struct virtio_pci_modern_device *mdev)
        err = -EINVAL;
        mdev->common = vp_modern_map_capability(mdev, common,
                                      sizeof(struct virtio_pci_common_cfg), 4,
-                                     0, sizeof(struct virtio_pci_common_cfg),
+                                     0, sizeof(struct virtio_pci_modern_common_cfg),
                                      NULL, NULL);
        if (!mdev->common)
                goto err_map_common;
This page took 0.055661 seconds and 4 git commands to generate.