From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: [PATCH 2/2] virtio: fix double free_irq Date: Tue, 21 Jul 2009 18:59:25 +0300 Message-ID: <20090721155925.GC3306@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: Rusty Russell , Christian Borntraeger , virtualization@lists.linux-foundation.org, Anthony Liguori , kvm@vger.ker Return-path: Received: from mx2.redhat.com ([66.187.237.31]:59828 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752961AbZGUQA3 (ORCPT ); Tue, 21 Jul 2009 12:00:29 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Decrement used vectors counter when removing the vq so that vp_free_vectors does not try to free the vector again. Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_pci.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index dab3c86..9dcc368 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -466,8 +466,10 @@ static void vp_del_vq(struct virtqueue *vq) iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); - if (info->vector != VIRTIO_MSI_NO_VECTOR) + if (info->vector != VIRTIO_MSI_NO_VECTOR) { free_irq(vp_dev->msix_entries[info->vector].vector, vq); + --vp_dev->msix_used_vectors; + } if (vp_dev->msix_enabled) { iowrite16(VIRTIO_MSI_NO_VECTOR, -- 1.6.2.5