Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: kvm@vger.kernel.org
Cc: avi@redhat.com, mtosatti@redhat.com
Subject: [patch] add some unlocks on error paths irq_comm.c
Date: Tue, 10 Nov 2009 10:57:09 +0200 (SAST)	[thread overview]
Message-ID: <alpine.DEB.2.00.0911081905380.8081@bicker> (raw)

There were a couple unlocks missing.  They were found by smatch static 
checker.  Compile tested.

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27@gmail.com>

--- orig/virt/kvm/irq_comm.c	2009-11-08 19:00:50.000000000 +0200
+++ devel/virt/kvm/irq_comm.c	2009-11-08 19:04:45.000000000 +0200
@@ -209,6 +209,7 @@
 				sizeof(kvm->arch.irq_sources_bitmap));
 
 	if (irq_source_id >= sizeof(kvm->arch.irq_sources_bitmap)) {
+		mutex_unlock(&kvm->irq_lock);
 		printk(KERN_WARNING "kvm: exhaust allocatable IRQ sources!\n");
 		return -EFAULT;
 	}
@@ -229,6 +230,7 @@
 	mutex_lock(&kvm->irq_lock);
 	if (irq_source_id < 0 ||
 	    irq_source_id >= sizeof(kvm->arch.irq_sources_bitmap)) {
+		mutex_unlock(&kvm->irq_lock);
 		printk(KERN_ERR "kvm: IRQ source ID out of range!\n");
 		return;
 	}

             reply	other threads:[~2009-11-10  8:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-10  8:57 Dan Carpenter [this message]
2009-11-12 23:35 ` [patch] add some unlocks on error paths irq_comm.c Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.0911081905380.8081@bicker \
    --to=error27@gmail.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox