提交 a47d4576 编写于 作者: T Thomas Gleixner

x86/irq: Do not dereference irq descriptor before checking it

Having the IS_NULL_OR_ERR() check after dereferencing the pointer is
not really working well.

Move the dereference after the check.

Fixes: a782a7e4 'x86/irq: Store irq descriptor in vector array'
Reported-and-tested-by: NIngo Molnar <mingo@kernel.org>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 b51aa1cc
......@@ -150,7 +150,7 @@ void do_softirq_own_stack(void)
bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
{
unsigned int irq = irq_desc_get_irq(desc);
unsigned int irq;
int overflow;
overflow = check_stack_overflow();
......@@ -158,6 +158,7 @@ bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
if (IS_ERR_OR_NULL(desc))
return false;
irq = irq_desc_get_irq(desc);
if (user_mode(regs) || !execute_on_irq_stack(overflow, desc, irq)) {
if (unlikely(overflow))
print_stack_overflow();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册