2014-09-18 06:40:12

by Wojciech Dubowik

[permalink] [raw]
Subject: [PATCH] ath9k: Fix NULL pointer dereference on early irq

The ah struct might not have been initialized when
interrupt comes so check for it.

Signed-off-by: Wojciech Dubowik <[email protected]>
---
drivers/net/wireless/ath/ath9k/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 3e485f7..fbf23ac 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -504,7 +504,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 */
--
1.9.1