lkml.org 
[lkml]   [2010]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: S2R resume crash in 2.6.33-rc7 - NULL pointer dereference in dev_get_drvdata() for usbhid
On Mon, 08 February 2010 Bruno Prémont <bonbons@linux-vserver.org> wrote:
> 2.6.33-rc7 (don't know if any previous version resumes properly)
> crashes during resume from S2Ram when my USB keyboard is connected but
> resumes properly (viafb corruption put apart) when the USB keyboard is
> not connected.

The patch below works around the crash though the WARN_ON() in
usbhid_restart_out_queue() triggers in place.

Bruno

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index e2997a8..d2f8eef 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -196,7 +196,7 @@ static void usbhid_mark_busy(struct usbhid_device *usbhid)

static int usbhid_restart_out_queue(struct usbhid_device *usbhid)
{
- struct hid_device *hid = usb_get_intfdata(usbhid->intf);
+ struct hid_device *hid = usbhid->intf ? usb_get_intfdata(usbhid->intf) : NULL;
int kicked;

if (!hid)
@@ -214,7 +214,7 @@ static int usbhid_restart_out_queue(struct usbhid_device *usbhid)

static int usbhid_restart_ctrl_queue(struct usbhid_device *usbhid)
{
- struct hid_device *hid = usb_get_intfdata(usbhid->intf);
+ struct hid_device *hid = usbhid->intf ? usb_get_intfdata(usbhid->intf) : NULL;
int kicked;

WARN_ON(hid == NULL);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2010-02-08 19:09    [W:0.092 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site