Skip to content

Commit

Permalink
[IA64] Fix wrong access to irq_desc[] in iosapic_register_intr().
Browse files Browse the repository at this point in the history
In error path we must unlock irq_desc[irq].lock before we change
'irq'.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Kenji Kaneshige authored and Tony Luck committed Aug 1, 2007
1 parent 216fcd2 commit 224685c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/ia64/kernel/iosapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,9 @@ iosapic_register_intr (unsigned int gsi,
err = register_intr(gsi, irq, IOSAPIC_LOWEST_PRIORITY,
polarity, trigger);
if (err < 0) {
spin_unlock(&irq_desc[irq].lock);
irq = err;
goto unlock_all;
goto unlock_iosapic_lock;
}

/*
Expand All @@ -811,7 +812,7 @@ iosapic_register_intr (unsigned int gsi,
gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"),
(polarity == IOSAPIC_POL_HIGH ? "high" : "low"),
cpu_logical_id(dest), dest, irq_to_vector(irq));
unlock_all:

spin_unlock(&irq_desc[irq].lock);
unlock_iosapic_lock:
spin_unlock_irqrestore(&iosapic_lock, flags);
Expand Down

0 comments on commit 224685c

Please sign in to comment.