Char: cyclades, allow DEBUG_SHIRQ
authorJiri Slaby <jirislaby@gmail.com>
Tue, 8 May 2007 07:36:24 +0000 (00:36 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 8 May 2007 18:15:24 +0000 (11:15 -0700)
Test if base addr is non-null in ISR to prove the card has been correctly
initialized.  This is needed for DEBUG_SHIRQ for example.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/cyclades.c

index 353e888295d1f9af1a3de705ab45770c2abb9b2a..9d22d58f4298637ed9964d8f876199998f9e09bc 100644 (file)
@@ -1444,6 +1444,10 @@ static irqreturn_t cyy_interrupt(int irq, void *dev_id)
        card_base_addr = cinfo->base_addr;
        index = cinfo->bus_index;
 
+       /* card was not initialized yet (e.g. DEBUG_SHIRQ) */
+       if (unlikely(card_base_addr == NULL))
+               return IRQ_HANDLED;
+
        /* This loop checks all chips in the card.  Make a note whenever
           _any_ chip had some work to do, as this is considered an
           indication that there will be more to do.  Only when no chip