OSDN Git Service

msix: use range helper function.
authorIsaku Yamahata <yamahata@valinux.co.jp>
Tue, 15 Dec 2009 11:26:04 +0000 (20:26 +0900)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 23 Dec 2009 14:35:00 +0000 (16:35 +0200)
use range helper function in msix_write_config().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/msix.c

index 0baedef..2ca0900 100644 (file)
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -175,7 +175,7 @@ void msix_write_config(PCIDevice *dev, uint32_t addr,
     unsigned enable_pos = dev->msix_cap + MSIX_CONTROL_OFFSET;
     int vector;
 
-    if (addr + len <= enable_pos || addr > enable_pos) {
+    if (!range_covers_byte(addr, len, enable_pos)) {
         return;
     }