From e147d83835a64798cc7e1ee09e992ebb90b9d3ea Mon Sep 17 00:00:00 2001 From: Asias He Date: Wed, 13 Apr 2011 00:23:29 +0800 Subject: [PATCH] kvm tools: Fix lock imbalance in virtio_console_pci_io_out() Signed-off-by: Asias He Signed-off-by: Pekka Enberg --- virtio-console.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/virtio-console.c b/virtio-console.c index 9675090..aa9b1bd 100644 --- a/virtio-console.c +++ b/virtio-console.c @@ -163,6 +163,8 @@ static bool virtio_console_pci_io_out(struct kvm *self, uint16_t port, void *dat unsigned long offset = port - IOPORT_VIRTIO_CONSOLE; bool ret = true; + mutex_lock(&console_device.mutex); + switch (offset) { case VIRTIO_PCI_GUEST_FEATURES: console_device.guest_features = ioport__read32(data);