Linux wireless drivers development
 help / color / mirror / Atom feed
From: Meelis Roos <mroos@linux.ee>
To: linux-wireless@vger.kernel.org
Subject: [PATCH] orinoco_cs: fix too early irq request
Date: Sat, 18 Dec 2010 00:18:24 +0200 (EET)	[thread overview]
Message-ID: <alpine.SOC.1.00.1012180014390.26257@math.ut.ee> (raw)

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)

             reply	other threads:[~2010-12-17 22:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-17 22:18 Meelis Roos [this message]
2010-12-18 10:58 ` [PATCH] orinoco_cs: fix too early irq request Dave Kilroy
2010-12-19 14:43   ` Meelis Roos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.SOC.1.00.1012180014390.26257@math.ut.ee \
    --to=mroos@linux.ee \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox