Commit 176a6024 authored by Vojtech Pavlik's avatar Vojtech Pavlik

input: Fix oops (NULL pointer dereference) on resume in psmouse.c,

       when the mouse goes away while sleeping.
parent 54c1ae21
...@@ -643,13 +643,15 @@ static int psmouse_reconnect(struct serio *serio) ...@@ -643,13 +643,15 @@ static int psmouse_reconnect(struct serio *serio)
{ {
struct psmouse *psmouse = serio->private; struct psmouse *psmouse = serio->private;
struct serio_dev *dev = serio->dev; struct serio_dev *dev = serio->dev;
int old_type = psmouse->type; int old_type;
if (!dev) { if (!dev || !psmouse) {
printk(KERN_DEBUG "psmouse: reconnect request, but serio is disconnected, ignoring...\n"); printk(KERN_DEBUG "psmouse: reconnect request, but serio is disconnected, ignoring...\n");
return -1; return -1;
} }
old_type = psmouse->type;
psmouse->state = PSMOUSE_NEW_DEVICE; psmouse->state = PSMOUSE_NEW_DEVICE;
psmouse->type = psmouse->acking = psmouse->cmdcnt = psmouse->pktcnt = 0; psmouse->type = psmouse->acking = psmouse->cmdcnt = psmouse->pktcnt = 0;
if (psmouse->reconnect) { if (psmouse->reconnect) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment