diff mbox

[BUG,Regression,bisected] USB mouse causes bug on 1st insert, ignored on 2nd insert, lsusb stuck at usbdev_open

Message ID alpine.LNX.2.00.1009201524340.26813@pobox.suse.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Jiri Kosina Sept. 20, 2010, 1:25 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index 681e620..3a5f097 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -270,17 +270,26 @@  static int hiddev_open(struct inode *inode, struct file *file)
 	struct hiddev *hiddev;
 	int res;
 
+	printk("A\n");
 	intf = usbhid_find_interface(iminor(inode));
+	printk("B\n");
 	if (!intf)
 		return -ENODEV;
+	printk("C\n");
 	hid = usb_get_intfdata(intf);
+	printk("D\n");
 	hiddev = hid->hiddev;
+	printk("E\n");
 
 	if (!(list = kzalloc(sizeof(struct hiddev_list), GFP_KERNEL)))
 		return -ENOMEM;
+	printk("F\n");
 	mutex_init(&list->thread_lock);
+	printk("G\n");
 	list->hiddev = hiddev;
+	printk("H\n");
 	file->private_data = list;
+	printk("I\n");
 
 	/*
 	 * no need for locking because the USB major number
@@ -298,11 +307,14 @@  static int hiddev_open(struct inode *inode, struct file *file)
 		res = -ENODEV;
 		goto bail;
 	}
+	printk("J\n");
 
 	spin_lock_irq(&list->hiddev->list_lock);
 	list_add_tail(&list->node, &hiddev->list);
 	spin_unlock_irq(&list->hiddev->list_lock);
 
+	printk("K\n");
+
 	if (!list->hiddev->open++)
 		if (list->hiddev->exist) {
 			struct hid_device *hid = hiddev->hid;
@@ -313,10 +325,13 @@  static int hiddev_open(struct inode *inode, struct file *file)
 			}
 			usbhid_open(hid);
 		}
+	printk("L\n");
 	return 0;
 bail:
+	printk("M\n");
 	file->private_data = NULL;
 	kfree(list);
+	printk("N\n");
 	return res;
 }