Skip to content

Commit

Permalink
KVM: Clean up coalesced_mmio destruction
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Chris Wright <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
Gregory Haskins authored and avikivity committed Sep 10, 2009
1 parent 2986b8c commit 787a660
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion virt/kvm/coalesced_mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 787a660

Please sign in to comment.