Skip to contentSkip to conversation

USB speedtouch: be firm when disconnected

PATCH Applied Duncan Sands 2 participants 2 messages Feb 28, 2003 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB speedtouch: be firm when disconnected

Just say -ENODEV

 speedtouch.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
drivers/usb/misc/speedtouch.c +6 -5
diff -Nru a/drivers/usb/misc/speedtouch.c b/drivers/usb/misc/speedtouch.c
@@ -648,9 +648,9 @@
 
 	dbg ("udsl_atm_send called (skb 0x%p, len %u)", skb, skb->len);
 
-	if (!instance) {
-		dbg ("NULL instance!");
-		return -EINVAL;
+	if (!instance || !instance->usb_dev) {
+		dbg ("NULL data!");
+		return -ENODEV;
 	}
 
 	if (!instance->firmware_loaded)
@@ -701,6 +701,7 @@
 	tasklet_kill (&instance->send_tasklet);
 	dbg ("udsl_atm_dev_close: freeing instance");
 	kfree (instance);
+	dev->dev_data = NULL;
 }
 
 
@@ -776,8 +777,8 @@
 
 	dbg ("udsl_atm_open called");
 
-	if (!instance) {
-		dbg ("NULL instance!");
+	if (!instance || !instance->usb_dev) {
+		dbg ("NULL data!");
 		return -ENODEV;
 	}
 
Applied
#1 lore raw
Quoted 1 line · Duncan Sands

Just say -ENODEV

Applied, thanks.

greg k-h