KVM: ia64: Fix irq disabling leak in error handling code

There is a call to local_irq_restore in the normal exit case, so it would
seem that there should be one on an error return as well.

The semantic patch that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression l;
expression E,E1,E2;
@@

local_irq_save(l);
... when != local_irq_restore(l)
when != spin_unlock_irqrestore(E,l)
when any
when strict
(
if (...) { ... when != local_irq_restore(l)
when != spin_unlock_irqrestore(E1,l)
+ local_irq_restore(l);
return ...;
}
|
if (...)
+ {local_irq_restore(l);
return ...;
+ }
|
spin_unlock_irqrestore(E2,l);
|
local_irq_restore(l);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Avi Kivity <avi@qumranet.com>

authored by

Julia Lawall and committed by
Avi Kivity
cab7a1ee 5fdbcb9d

+3 -2
+3 -2
arch/ia64/kvm/kvm-ia64.c
··· 125 125 PAGE_KERNEL)); 126 126 local_irq_save(saved_psr); 127 127 slot = ia64_itr_entry(0x3, KVM_VMM_BASE, pte, KVM_VMM_SHIFT); 128 + local_irq_restore(saved_psr); 128 129 if (slot < 0) 129 130 return; 130 - local_irq_restore(saved_psr); 131 131 132 132 spin_lock(&vp_lock); 133 133 status = ia64_pal_vp_init_env(kvm_vsa_base ? ··· 160 160 161 161 local_irq_save(saved_psr); 162 162 slot = ia64_itr_entry(0x3, KVM_VMM_BASE, pte, KVM_VMM_SHIFT); 163 + local_irq_restore(saved_psr); 163 164 if (slot < 0) 164 165 return; 165 - local_irq_restore(saved_psr); 166 166 167 167 status = ia64_pal_vp_exit_env(host_iva); 168 168 if (status) ··· 1253 1253 uninit: 1254 1254 kvm_vcpu_uninit(vcpu); 1255 1255 fail: 1256 + local_irq_restore(psr); 1256 1257 return r; 1257 1258 } 1258 1259