Commit 27c4ba60 authored by Jiri Slaby's avatar Jiri Slaby Committed by Avi Kivity

KVM: fix lock imbalance

There is a missing unlock on one fail path in ioapic_mmio_write,
fix that.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 22fc0294
...@@ -292,7 +292,7 @@ static int ioapic_mmio_write(struct kvm_io_device *this, gpa_t addr, int len, ...@@ -292,7 +292,7 @@ static int ioapic_mmio_write(struct kvm_io_device *this, gpa_t addr, int len,
data = *(u32 *) val; data = *(u32 *) val;
else { else {
printk(KERN_WARNING "ioapic: Unsupported size %d\n", len); printk(KERN_WARNING "ioapic: Unsupported size %d\n", len);
return 0; goto unlock;
} }
addr &= 0xff; addr &= 0xff;
...@@ -313,6 +313,7 @@ static int ioapic_mmio_write(struct kvm_io_device *this, gpa_t addr, int len, ...@@ -313,6 +313,7 @@ static int ioapic_mmio_write(struct kvm_io_device *this, gpa_t addr, int len,
default: default:
break; break;
} }
unlock:
mutex_unlock(&ioapic->kvm->irq_lock); mutex_unlock(&ioapic->kvm->irq_lock);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment