genirq: Reuse existing can set affinty check

Add a !desc check while at it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
Thomas Gleixner
2011-02-10 22:37:41 +01:00
parent a005677b3d
commit bce43032ad
2 changed files with 3 additions and 4 deletions

View File

@ -73,8 +73,8 @@ int irq_can_set_affinity(unsigned int irq)
{
struct irq_desc *desc = irq_to_desc(irq);
if (!irqd_can_balance(&desc->irq_data) || !desc->irq_data.chip ||
!desc->irq_data.chip->irq_set_affinity)
if (!desc || !irqd_can_balance(&desc->irq_data) ||
!desc->irq_data.chip || !desc->irq_data.chip->irq_set_affinity)
return 0;
return 1;