All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH resent] lis3: Fix Oops with NULL platform data
@ 2010-09-22 11:34 Takashi Iwai
  2010-09-22 11:37 ` Takashi Iwai
  2010-09-22 11:56 ` samu.p.onkalo
  0 siblings, 2 replies; 8+ messages in thread
From: Takashi Iwai @ 2010-09-22 11:34 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Samu Onkalo, Éric Piel, linux-kernel

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


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

end of thread, other threads:[~2010-09-23  5:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-22 11:34 [PATCH resent] lis3: Fix Oops with NULL platform data Takashi Iwai
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     ` [lm-sensors] [PATCH resent] lis3: Fix Oops with NULL platform samu.p.onkalo
2010-09-23  5:06       ` [PATCH resent] lis3: Fix Oops with NULL platform data samu.p.onkalo
2010-09-23  5:33       ` [lm-sensors] [PATCH resent] lis3: Fix Oops with NULL platform Guenter Roeck
2010-09-23  5:33         ` [lm-sensors] [PATCH resent] lis3: Fix Oops with NULL platform data Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.