Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] orinoco_cs: fix too early irq request
@ 2010-12-17 22:18 Meelis Roos
  2010-12-18 10:58 ` Dave Kilroy
  0 siblings, 1 reply; 3+ messages in thread
From: Meelis Roos @ 2010-12-17 22:18 UTC (permalink / raw)
  To: linux-wireless

orinoco_cs requests its irq too early. This results in irq coming in 
right afrer request_irq and before initializing other data structures, 
resulting in NULL pointer dereference on module load.

Fix it by moving request_irq after other initialization tasks.

Tested to work with Orinoco Gold PCMCIA card.

Signed-off-by: Meelis Roos <mroos@linux.ee>

diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index 71b3d68..47fc408 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -151,10 +151,6 @@ orinoco_cs_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	ret = pcmcia_request_irq(link, orinoco_interrupt);
-	if (ret)
-		goto failed;
-
 	/* We initialize the hermes structure before completing PCMCIA
 	 * configuration just in case the interrupt handler gets
 	 * called. */
@@ -182,6 +178,10 @@ orinoco_cs_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
+	ret = pcmcia_request_irq(link, orinoco_interrupt);
+	if (ret)
+		goto failed;
+
 	return 0;
 
  failed:

-- 
Meelis Roos (mroos@linux.ee)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-19 14:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-17 22:18 [PATCH] orinoco_cs: fix too early irq request Meelis Roos
2010-12-18 10:58 ` Dave Kilroy
2010-12-19 14:43   ` Meelis Roos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox