Skip to contentSkip to conversation

usb: usbtmc: Fix disconnect/poll interaction

PATCH Superseded Dave Penkler 2 participants 2 messages Feb 17, 2016 USB

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: usbtmc: Fix disconnect/poll interaction

When the device is disconnected poll waiters were not being woken. Fixes issue in commit eb6b92ecc0f9412623ab1584ddd8389b371638d4 reported by Oliver Neukum

---
 drivers/usb/class/usbtmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/class/usbtmc.c +2 -1
index 419c72e..917a55c 100644
@@ -1525,13 +1525,14 @@ static void usbtmc_disconnect(struct usb_interface *intf)
 	dev_dbg(&intf->dev, "usbtmc_disconnect called\n");
 
 	data = usb_get_intfdata(intf);
-	usbtmc_free_int(data);
 	usb_deregister_dev(intf, &usbtmc_class);
 	sysfs_remove_group(&intf->dev.kobj, &capability_attr_grp);
 	sysfs_remove_group(&intf->dev.kobj, &data_attr_grp);
 	mutex_lock(&data->io_mutex);
 	data->zombie = 1;
+	wake_up_all(&data->waitq);
 	mutex_unlock(&data->io_mutex);
+	usbtmc_free_int(data);
 	kref_put(&data->kref, usbtmc_delete);
 }
 
Signature · 1 line
2.6.3
#1 lore raw

Hello.

Quoted 2 lines · Dave Penkler

When the device is disconnected poll waiters were not being woken. Fixes issue in commit eb6b92ecc0f9412623ab1584ddd8389b371638d4 reported

scripts/checkpatch.pl now enforces certain commit citing format, yours
doesn't match it, not only because you missed to specify the commit summary. :-)

Quoted 1 line

by Oliver Neukum

Note that there are also "Fixes:" and "Reported-by:" tags for that.

Quoted 1 line

[...]

MBR, Sergei