Received: from [140.186.70.92] (port=46666 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcK13-0002D4-H2 for qemu-devel@nongnu.org; Fri, 23 Jul 2010 11:18:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OcJzY-00053W-33 for qemu-devel@nongnu.org; Fri, 23 Jul 2010 11:16:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40939) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcJzX-00053D-SO for qemu-devel@nongnu.org; Fri, 23 Jul 2010 11:16:52 -0400 From: Jes.Sorensen@redhat.com Date: Fri, 23 Jul 2010 17:16:42 +0200 Message-Id: <1279898202-7223-1-git-send-email-Jes.Sorensen@redhat.com> Subject: [Qemu-devel] [PATCH] vhost_dev_unassign_memory() don't assert if removing first entry in list. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com From: Jes Sorensen If removing an entry from the list which is fully included in the region and this is the first entry in the list. In this case 'to' can go to -1, which is perfectly valid. Don't assert() on this case. Signed-off-by: Jes Sorensen --- hw/vhost.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/hw/vhost.c b/hw/vhost.c index d37a66e..f30cf91 100644 --- a/hw/vhost.c +++ b/hw/vhost.c @@ -119,7 +119,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; } -- 1.7.1.1