Skip to content

Commit

Permalink
KVM: fix lock imbalance
Browse files Browse the repository at this point in the history
There is a missing unlock on one fail path in ioapic_mmio_write,
fix that.

Signed-off-by: Jiri Slaby <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
jirislaby authored and avikivity committed Sep 10, 2009
1 parent 22fc029 commit 27c4ba6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion virt/kvm/ioapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ static int ioapic_mmio_write(struct kvm_io_device *this, gpa_t addr, int len,
data = *(u32 *) val;
else {
printk(KERN_WARNING "ioapic: Unsupported size %d\n", len);
return 0;
goto unlock;
}

addr &= 0xff;
Expand All @@ -313,6 +313,7 @@ static int ioapic_mmio_write(struct kvm_io_device *this, gpa_t addr, int len,
default:
break;
}
unlock:
mutex_unlock(&ioapic->kvm->irq_lock);
return 0;
}
Expand Down

0 comments on commit 27c4ba6

Please sign in to comment.