public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Duncan Sands <baldrick@wanadoo.fr>
To: linux-usb-devel@lists.sourceforge.net
Cc: Greg KH <greg@kroah.com>, linux-kernel@vger.kernel.org
Subject: [PATCH] USB speedtouch: be firm when disconnected
Date: Fri, 28 Feb 2003 10:15:37 +0100	[thread overview]
Message-ID: <200302281015.37848.baldrick@wanadoo.fr> (raw)

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;
 	}
 


             reply	other threads:[~2003-02-28  9:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-28  9:15 Duncan Sands [this message]
2003-02-28 21:32 ` [PATCH] USB speedtouch: be firm when disconnected Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200302281015.37848.baldrick@wanadoo.fr \
    --to=baldrick@wanadoo.fr \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox