From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFzoQ-0002ts-7A for qemu-devel@nongnu.org; Fri, 29 Apr 2011 22:21:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFvp4-0001VF-Gi for qemu-devel@nongnu.org; Fri, 29 Apr 2011 18:06:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFvp4-0001TC-6c for qemu-devel@nongnu.org; Fri, 29 Apr 2011 18:06:02 -0400 From: Alex Williamson Date: Fri, 29 Apr 2011 16:05:54 -0600 Message-ID: <20110429220534.10316.63083.stgit@s20.home> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] vfio: Fix free in dma mapping error path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: pugs@ieee.org Cc: chrisw@redhat.com, linux-pci@vger.kernel.org, alex.williamson@redhat.com, linux-kernel@vger.kernel.org, qemu-devel@nongnu.org This is allocated via vmalloc, so needs vfree, not kfree. Signed-off-by: Alex Williamson --- drivers/vfio/vfio_dma.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/vfio/vfio_dma.c b/drivers/vfio/vfio_dma.c index cee1a25..4a488b6 100644 --- a/drivers/vfio/vfio_dma.c +++ b/drivers/vfio/vfio_dma.c @@ -322,7 +322,7 @@ int vfio_dma_map_common(struct vfio_listener *listener, if (ret != npage) { printk(KERN_ERR "%s: get_user_pages_fast returns %d, not %d\n", __func__, ret, npage); - kfree(pages); + vfree(pages); ret = -EFAULT; goto out_lock; }