Commit 693eb251 authored by Vojtech Pavlik's avatar Vojtech Pavlik

Fix open counting in usbkbd.c and usbmouse.c in case the irq urb

submit fails. Bug spotted by Thiemo Seufer.
parent 61288a58
...@@ -163,8 +163,10 @@ static int usb_kbd_open(struct input_dev *dev) ...@@ -163,8 +163,10 @@ static int usb_kbd_open(struct input_dev *dev)
return 0; return 0;
kbd->irq->dev = kbd->usbdev; kbd->irq->dev = kbd->usbdev;
if (usb_submit_urb(kbd->irq, GFP_KERNEL)) if (usb_submit_urb(kbd->irq, GFP_KERNEL)) {
kbd->open--;
return -EIO; return -EIO;
}
return 0; return 0;
} }
......
...@@ -86,8 +86,10 @@ static int usb_mouse_open(struct input_dev *dev) ...@@ -86,8 +86,10 @@ static int usb_mouse_open(struct input_dev *dev)
return 0; return 0;
mouse->irq->dev = mouse->usbdev; mouse->irq->dev = mouse->usbdev;
if (usb_submit_urb(mouse->irq, GFP_KERNEL)) if (usb_submit_urb(mouse->irq, GFP_KERNEL)) {
mouse->open--;
return -EIO; return -EIO;
}
return 0; return 0;
} }
......
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