From: Takashi Iwai <tiwai@suse.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Samu Onkalo" <samu.p.onkalo@nokia.com>,
"Éric Piel" <Eric.Piel@tremplin-utc.net>,
linux-kernel@vger.kernel.org
Subject: [PATCH resent] lis3: Fix Oops with NULL platform data
Date: Wed, 22 Sep 2010 13:34:11 +0200 [thread overview]
Message-ID: <s5htyli811o.wl%tiwai@suse.de> (raw)
The recent addition of threaded irq handler causes a NULL dereference
when used with hp_accel driver, which has NULL pdata.
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
This should go to 2.6.36 and 2.6.35-stable tree.
drivers/hwmon/lis3lv02d.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/lis3lv02d.c b/drivers/hwmon/lis3lv02d.c
index 5e15967..1c266ec 100644
--- a/drivers/hwmon/lis3lv02d.c
+++ b/drivers/hwmon/lis3lv02d.c
@@ -354,7 +354,8 @@ static irqreturn_t lis302dl_interrupt_thread1_8b(int irq, void *data)
struct lis3lv02d *lis3 = data;
- if ((lis3->pdata->irq_cfg & LIS3_IRQ1_MASK) == LIS3_IRQ1_CLICK)
+ if (lis3->pdata &&
+ (lis3->pdata->irq_cfg & LIS3_IRQ1_MASK) == LIS3_IRQ1_CLICK)
lis302dl_interrupt_handle_click(lis3);
else
lis302dl_interrupt_handle_ff_wu(lis3);
@@ -367,7 +368,8 @@ static irqreturn_t lis302dl_interrupt_thread2_8b(int irq, void *data)
struct lis3lv02d *lis3 = data;
- if ((lis3->pdata->irq_cfg & LIS3_IRQ2_MASK) == LIS3_IRQ2_CLICK)
+ if (lis3->pdata &&
+ (lis3->pdata->irq_cfg & LIS3_IRQ2_MASK) == LIS3_IRQ2_CLICK)
lis302dl_interrupt_handle_click(lis3);
else
lis302dl_interrupt_handle_ff_wu(lis3);
--
1.7.2.2
next reply other threads:[~2010-09-22 11:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-22 11:34 Takashi Iwai [this message]
2010-09-22 11:37 ` Takashi Iwai
2010-09-22 11:56 ` samu.p.onkalo
2010-09-22 13:47 ` Takashi Iwai
2010-09-23 5:06 ` samu.p.onkalo
2010-09-23 5:33 ` [lm-sensors] " Guenter Roeck
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=s5htyli811o.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=Eric.Piel@tremplin-utc.net \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=samu.p.onkalo@nokia.com \
/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
all inboxes | Powered by JetHome®