Skip to content

Commit 4e94ebd

Browse files
ladipromstsirkin
authored andcommitted
virtio-pci: read the right virtio_pci_notify_cap field
Looks like a copy-paste bug. The value is used as an optimization and a wrong value probably isn't causing any serious damage. Found when porting this code to Windows. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent fc77dbd commit 4e94ebd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/virtio/virtio_pci_modern.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
679679

680680
pci_read_config_dword(pci_dev,
681681
notify + offsetof(struct virtio_pci_notify_cap,
682-
cap.length),
682+
cap.offset),
683683
&notify_offset);
684684

685685
/* We don't know how many VQs we'll map, ahead of the time.

0 commit comments

Comments
 (0)