Skip to contentSkip to conversation

orinoco_cs: fix too early irq request

PATCH In review Meelis Roos 2 participants 3 messages Dec 17, 2010 – Dec 19, 2010 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 orinoco_cs: fix too early irq request

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.

drivers/net/wireless/orinoco/orinoco_cs.c +4 -4
index 71b3d68..47fc408 100644
@@ -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:
Signature · 1 line
Meelis Roos ([email protected])
#1 lore raw

Thanks Meelis. An equivalent patch has already been merged in Linus' v2.6.37-rc6 (229bd792b), and wireless-next.

Does that version also work for you?

Quoted 44 lines · Meelis Roos

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.

drivers/net/wireless/orinoco/orinoco_cs.c +4 -4
index 71b3d68..47fc408 100644
@@ -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 ([email protected])
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 2 lines

Thanks Meelis. An equivalent patch has already been merged in Linus' v2.6.37-rc6 (229bd792b), and wireless-next.

Oops, I tested with 2.6.37-rc4-something when I thought I was testing the lastest git.

Quoted 1 line

Does that version also work for you?

Yes, tested with 2.6.37-rc6-00093 and it works fine.

Signature · 1 line
Meelis Roos ([email protected])