From patchwork Sun Aug 16 09:29:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 41722 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7G9ghTw009526 for ; Sun, 16 Aug 2009 09:42:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754829AbZHPJfn (ORCPT ); Sun, 16 Aug 2009 05:35:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754232AbZHPJfl (ORCPT ); Sun, 16 Aug 2009 05:35:41 -0400 Received: from mx2.redhat.com ([66.187.237.31]:45355 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753808AbZHPJaN (ORCPT ); Sun, 16 Aug 2009 05:30:13 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7G9UEhM032035; Sun, 16 Aug 2009 05:30:15 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7G9UDdA023480; Sun, 16 Aug 2009 05:30:13 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7G9UCDH005106; Sun, 16 Aug 2009 05:30:12 -0400 Received: from localhost.localdomain (cleopatra.tlv.redhat.com [10.35.255.11]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id E4ADD250AEE; Sun, 16 Aug 2009 12:30:09 +0300 (IDT) From: Avi Kivity To: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 23/48] KVM: Clean up coalesced_mmio destruction Date: Sun, 16 Aug 2009 12:29:43 +0300 Message-Id: <1250415008-17175-24-git-send-email-avi@redhat.com> In-Reply-To: <1250415008-17175-1-git-send-email-avi@redhat.com> References: <1250415008-17175-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Gregory Haskins We invoke kfree() on a data member instead of the structure. This works today because the kvm_io_device is the first element of the private structure, but this could change in the future, so lets clean this up. Signed-off-by: Gregory Haskins Acked-by: Chris Wright Signed-off-by: Avi Kivity --- virt/kvm/coalesced_mmio.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/virt/kvm/coalesced_mmio.c b/virt/kvm/coalesced_mmio.c index 5ae620d..03ea280 100644 --- a/virt/kvm/coalesced_mmio.c +++ b/virt/kvm/coalesced_mmio.c @@ -80,7 +80,10 @@ static void coalesced_mmio_write(struct kvm_io_device *this, static void coalesced_mmio_destructor(struct kvm_io_device *this) { - kfree(this); + struct kvm_coalesced_mmio_dev *dev = + (struct kvm_coalesced_mmio_dev *)this->private; + + kfree(dev); } int kvm_coalesced_mmio_init(struct kvm *kvm)