From patchwork Fri Apr 29 22:05:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 742591 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3TM65k6024362 for ; Fri, 29 Apr 2011 22:06:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761017Ab1D2WGE (ORCPT ); Fri, 29 Apr 2011 18:06:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6795 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761015Ab1D2WGD (ORCPT ); Fri, 29 Apr 2011 18:06:03 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3TM5vbE006134 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 29 Apr 2011 18:05:57 -0400 Received: from s20.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p3TM5scr019660; Fri, 29 Apr 2011 18:05:55 -0400 From: Alex Williamson Subject: [PATCH] vfio: Fix free in dma mapping error path To: pugs@ieee.org Cc: alex.williamson@redhat.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, qemu-devel@nongnu.org, chrisw@redhat.com Date: Fri, 29 Apr 2011 16:05:54 -0600 Message-ID: <20110429220534.10316.63083.stgit@s20.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 29 Apr 2011 22:06:16 +0000 (UTC) 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }