lkml.org 
[lkml]   [2003]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] USB speedtouch: be firm when disconnected
Date
Just say -ENODEV


speedtouch.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)


diff -Nru a/drivers/usb/misc/speedtouch.c b/drivers/usb/misc/speedtouch.c
--- a/drivers/usb/misc/speedtouch.c Fri Feb 28 10:09:04 2003
+++ b/drivers/usb/misc/speedtouch.c Fri Feb 28 10:09:04 2003
@@ -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;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.018 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site