genirq: Warn if enable_irq is called before irq is set up

The recent changes in the genirq core unearthed a bug in arch/um which
called enable_irq() before the interrupt was set up.

Warn and return instead of crashing the machine with a NULL pointer
dereference.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Richard Weinberger <richard@nod.at>

+4
+4
kernel/irq/manage.c
··· 324 324 if (!desc) 325 325 return; 326 326 327 + if (WARN(!desc->irq_data.chip || !desc->irq_data.chip->irq_enable, 328 + KERN_ERR "enable_irq before setup/request_irq: irq %u\n", irq)) 329 + return; 330 + 327 331 chip_bus_lock(desc); 328 332 raw_spin_lock_irqsave(&desc->lock, flags); 329 333 __enable_irq(desc, irq, false);