ath9k: Fix NULL pointer dereference on early irq
authorWojciech Dubowik <Wojciech.Dubowik@neratec.com>
Thu, 18 Sep 2014 06:30:41 +0000 (08:30 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 22 Sep 2014 20:02:15 +0000 (16:02 -0400)
The ah struct might not have been initialized when
interrupt comes so check for it.

Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/main.c

index e6ac8d2..4b148bb 100644 (file)
@@ -513,7 +513,7 @@ irqreturn_t ath_isr(int irq, void *dev)
         * touch anything. Note this can happen early
         * on if the IRQ is shared.
         */
-       if (test_bit(ATH_OP_INVALID, &common->op_flags))
+       if (!ah || test_bit(ATH_OP_INVALID, &common->op_flags))
                return IRQ_NONE;
 
        /* shared irq, not for us */