From: Duncan Sands <baldrick@wanadoo.fr>
To: linux-usb-users@lists.sourceforge.net
Cc: Greg KH <greg@kroah.com>, linux-kernel@vger.kernel.org
Subject: [PATCH] USB speedtouch: handle usb_string failure
Date: Fri, 28 Feb 2003 13:31:31 +0100 [thread overview]
Message-ID: <200302281331.31161.baldrick@wanadoo.fr> (raw)
speedtouch.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff -Nru a/drivers/usb/misc/speedtouch.c b/drivers/usb/misc/speedtouch.c
--- a/drivers/usb/misc/speedtouch.c Fri Feb 28 13:23:18 2003
+++ b/drivers/usb/misc/speedtouch.c Fri Feb 28 13:23:18 2003
@@ -892,7 +892,6 @@
int ifnum = intf->altsetting->desc.bInterfaceNumber;
struct udsl_instance_data *instance;
unsigned char mac_str [13];
- unsigned char mac [6];
int i, length;
char *buf;
@@ -995,13 +994,10 @@
instance->atm_dev->link_rate = 128 * 1000 / 424;
/* set MAC address, it is stored in the serial number */
- usb_string (instance->usb_dev, instance->usb_dev->descriptor.iSerialNumber, mac_str, 13);
- for (i = 0; i < 6; i++)
- mac[i] = (hex2int (mac_str[i * 2]) * 16) + (hex2int (mac_str[i * 2 + 1]));
-
- dbg ("MAC is %02x:%02x:%02x:%02x:%02x:%02x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
-
- memcpy (instance->atm_dev->esi, mac, 6);
+ memset (instance->atm_dev->esi, 0, sizeof (instance->atm_dev->esi));
+ if (usb_string (dev, dev->descriptor.iSerialNumber, mac_str, sizeof (mac_str)) == 12)
+ for (i = 0; i < 6; i++)
+ instance->atm_dev->esi[i] = (hex2int (mac_str[i * 2]) * 16) + (hex2int (mac_str[i * 2 + 1]));
/* device description */
buf = instance->description;
next reply other threads:[~2003-02-28 12:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-28 12:31 Duncan Sands [this message]
2003-02-28 21:32 ` 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=200302281331.31161.baldrick@wanadoo.fr \
--to=baldrick@wanadoo.fr \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-users@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
all inboxes | Powered by JetHome®