mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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>,
	"Guenter Roeck" <guenter.roeck@ericsson.com>,
	linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org
Subject: [PATCH v2] lis3: Fix Oops with NULL platform data
Date: Thu, 23 Sep 2010 07:58:33 +0200	[thread overview]
Message-ID: <s5heiclngqe.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.

Acked-by: Samu Onkalo <samu.p.onkalo@nokia.com>
Acked-by: Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
For 2.6.35/36 kernel

v1->v2
  NULL-check in caller of request_threaded_irq() instead of checking in
  threaded irq handler

 drivers/hwmon/lis3lv02d.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/lis3lv02d.c b/drivers/hwmon/lis3lv02d.c
index 5e15967..0a24177 100644
--- a/drivers/hwmon/lis3lv02d.c
+++ b/drivers/hwmon/lis3lv02d.c
@@ -301,7 +301,7 @@ static irqreturn_t lis302dl_interrupt(int irq, void *dummy)
 	wake_up_interruptible(&lis3_dev.misc_wait);
 	kill_fasync(&lis3_dev.async_queue, SIGIO, POLL_IN);
 out:
-	if (lis3_dev.whoami == WAI_8B && lis3_dev.idev &&
+	if (lis3_dev.pdata && lis3_dev.whoami == WAI_8B && lis3_dev.idev &&
 	    lis3_dev.idev->input->users)
 		return IRQ_WAKE_THREAD;
 	return IRQ_HANDLED;
@@ -742,7 +742,7 @@ int lis3lv02d_init_device(struct lis3lv02d *dev)
 	 * io-apic is not configurable (and generates a warning) but I keep it
 	 * in case of support for other hardware.
 	 */
-	if (dev->whoami == WAI_8B)
+	if (dev->pdata && dev->whoami == WAI_8B)
 		thread_fn = lis302dl_interrupt_thread1_8b;
 	else
 		thread_fn = NULL;
-- 
1.7.2.2


             reply	other threads:[~2010-09-23  5:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-23  5:58 Takashi Iwai [this message]
2010-09-24 13:58 ` Guenter Roeck
2010-09-24 14:14   ` Takashi Iwai
2010-09-24 14:30     ` [lm-sensors] " Jean Delvare
2010-09-24 15:10       ` Jonathan Cameron
2010-09-24 15:17         ` Guenter Roeck
2010-09-24 17:07           ` Jonathan Cameron
2010-09-25 11:11             ` Jean Delvare
2010-09-25 11:01         ` Jean Delvare
2010-09-25 13:47           ` Jonathan Cameron
2010-09-24 15:16       ` Guenter Roeck
2010-09-24 15:22       ` Éric Piel
2010-09-24 17:14         ` Jonathan Cameron

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=s5heiclngqe.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=Eric.Piel@tremplin-utc.net \
    --cc=akpm@linux-foundation.org \
    --cc=guenter.roeck@ericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.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®