From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH 1/2] virtio: fix memory leak on device removal Date: Tue, 21 Jul 2009 19:03:15 +0300 Message-ID: <20090721160315.GA3341@redhat.com> References: <20090721155909.GB3306@redhat.com> 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]:59038 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753257AbZGUQEm (ORCPT ); Tue, 21 Jul 2009 12:04:42 -0400 Content-Disposition: inline In-Reply-To: <20090721155909.GB3306@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Free up msi vector tables. Signed-off-by: Michael S. Tsirkin --- Resending with corrected To list. Sorry about the churn. drivers/virtio/virtio_pci.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 193c8f0..dab3c86 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -489,12 +489,15 @@ static void vp_del_vq(struct virtqueue *vq) /* the config->del_vqs() implementation */ static void vp_del_vqs(struct virtio_device *vdev) { + struct virtio_pci_device *vp_dev = to_vp_device(vdev); struct virtqueue *vq, *n; list_for_each_entry_safe(vq, n, &vdev->vqs, list) vp_del_vq(vq); vp_free_vectors(vdev); + kfree(vp_dev->msix_names); + kfree(vp_dev->msix_entries); } /* the config->find_vqs() implementation */ -- 1.6.2.5