vhost: remove an incorrect assert
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 3 Aug 2011 12:24:41 +0000 (15:24 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 3 Aug 2011 15:00:53 +0000 (18:00 +0300)
The 'to' can go negative when the first region gets removed
(it gets incremented by to 0 immediately afterward), which
makes the assertion fail. Nothing breaks if
to < 0 here so just remove the assert.

Tested-by: David Ahern <daahern@cisco.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/vhost.c

index c3d88214fe0e5bf1271164e3c2c015fddc10ade5..19e72555c4b56ebd2130583e1c876f67f59a13a0 100644 (file)
@@ -120,7 +120,6 @@ static void vhost_dev_unassign_memory(struct vhost_dev *dev,
         if (start_addr <= reg->guest_phys_addr && memlast >= reglast) {
             --dev->mem->nregions;
             --to;
-            assert(to >= 0);
             ++overlap_middle;
             continue;
         }