kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 10/17] arch/ia64/kvm: Add missing spin_unlock
@ 2010-05-26 15:57 Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2010-05-26 15:57 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti, Xiantao Zhang, Tony Luck, Fenghua Yu,
	kvm

From: Julia Lawall <julia@diku.dk>

Add a spin_unlock missing on the error path.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression E1;
@@

* spin_lock(E1,...);
  <+... when != E1
  if (...) {
    ... when != E1
*   return ...;
  }
  ...+>
* spin_unlock(E1,...);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 arch/ia64/kvm/kvm-ia64.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
index d5f4e91..21b7013 100644
--- a/arch/ia64/kvm/kvm-ia64.c
+++ b/arch/ia64/kvm/kvm-ia64.c
@@ -144,6 +144,7 @@ int kvm_arch_hardware_enable(void *garbage)
 				VP_INIT_ENV : VP_INIT_ENV_INITALIZE,
 			__pa(kvm_vm_buffer), KVM_VM_BUFFER_BASE, &tmp_base);
 	if (status != 0) {
+		spin_unlock(&vp_lock);
 		printk(KERN_WARNING"kvm: Failed to Enable VT Support!!!!\n");
 		return -EINVAL;
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 10/17] arch/ia64/kvm: Add missing spin_unlock
       [not found] <Pine.LNX.4.64.1005261756490.23743@ask.diku.dk>
@ 2010-05-27 13:20 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2010-05-27 13:20 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Marcelo Tosatti, Xiantao Zhang, Tony Luck, Fenghua Yu, kvm,
	kvm-ia64, linux-ia64, linux-kernel, kernel-janitors

On 05/26/2010 06:57 PM, Julia Lawall wrote:
> From: Julia Lawall<julia@diku.dk>
>
> Add a spin_unlock missing on the error path.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> //<smpl>
> @@
> expression E1;
> @@
>
> * spin_lock(E1,...);
>    <+... when != E1
>    if (...) {
>      ... when != E1
> *   return ...;
>    }
>    ...+>
> * spin_unlock(E1,...);
> //</smpl>
>
>    

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-27 13:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.64.1005261756490.23743@ask.diku.dk>
2010-05-27 13:20 ` [PATCH 10/17] arch/ia64/kvm: Add missing spin_unlock Avi Kivity
2010-05-26 15:57 Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).