[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/11] vfio: fix return type of pread
From: |
Alex Williamson |
Subject: |
[Qemu-devel] [PULL 01/11] vfio: fix return type of pread |
Date: |
Mon, 06 Jul 2015 12:34:43 -0600 |
User-agent: |
StGit/0.17.1-dirty |
From: Paolo Bonzini <address@hidden>
size_t is an unsigned type, thus the error case is never reached in
the below call to pread. If bytes is negative, it will be seen as
a very high positive value.
Spotted by Coverity.
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>
---
hw/vfio/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index e0e339a..b8fa4ac 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -939,7 +939,7 @@ static void vfio_pci_load_rom(VFIOPCIDevice *vdev)
};
uint64_t size;
off_t off = 0;
- size_t bytes;
+ ssize_t bytes;
if (ioctl(vdev->vbasedev.fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) {
error_report("vfio: Error getting ROM info: %m");
- [Qemu-devel] [PULL 00/11] VFIO updates for 2.4-rc0, Alex Williamson, 2015/07/06
- [Qemu-devel] [PULL 02/11] cpu-all: complete "real" host page size API, Alex Williamson, 2015/07/06
- [Qemu-devel] [PULL 06/11] intc: arm_gic_kvm: set the qemu_irq/gsi mapping, Alex Williamson, 2015/07/06
- [Qemu-devel] [PULL 07/11] sysbus: add irq_routing_notifier, Alex Williamson, 2015/07/06
- [Qemu-devel] [PULL 08/11] kvm: some fixes to kvm_resamplefds_allowed, Alex Williamson, 2015/07/06
- [Qemu-devel] [PULL 09/11] hw/vfio/platform: add irqfd support, Alex Williamson, 2015/07/06
- [Qemu-devel] [PULL 10/11] vfio: Unregister IOMMU notifiers when container is destroyed, Alex Williamson, 2015/07/06
- [Qemu-devel] [PULL 11/11] vfio/pci : Add pba_offset PCI quirk for Chelsio T5 devices, Alex Williamson, 2015/07/06
- [Qemu-devel] [PULL 01/11] vfio: fix return type of pread,
Alex Williamson <=
- [Qemu-devel] [PULL 03/11] vfio: cpu: Use "real" page size API, Alex Williamson, 2015/07/06
- [Qemu-devel] [PULL 05/11] kvm-all.c: add qemu_irq/gsi hash table and utility routines, Alex Williamson, 2015/07/06
- [Qemu-devel] [PULL 04/11] kvm: rename kvm_irqchip_[add, remove]_irqfd_notifier with gsi suffix, Alex Williamson, 2015/07/06
- Re: [Qemu-devel] [PULL 00/11] VFIO updates for 2.4-rc0, Peter Maydell, 2015/07/07