]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: ia64: Fix irq disabling leak in error handling code
authorJulia Lawall <julia@diku.dk>
Wed, 13 Aug 2008 15:00:30 +0000 (18:00 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 20 Aug 2008 18:05:07 +0000 (11:05 -0700)
commit1cdf9677200f042502c4b710c3e4dbfe76624168
treeeb40570bd615907c09db4eaf35485724700f6d22
parent7827feb473214191591b0c74653e1155b3625bb0
KVM: ia64: Fix irq disabling leak in error handling code

(cherry picked from commit cab7a1eeeb007be309cd99cf14407261a72d2418)

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/ia64/kvm/kvm-ia64.c