diff mbox

S2R resume crash in 2.6.33-rc7 - NULL pointer dereference in dev_get_drvdata() for usbhid

Message ID 20100208190649.0ceea556@neptune.home (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Bruno Prémont Feb. 8, 2010, 6:06 p.m. UTC
None
diff mbox

Patch

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);