From: Jan Niehusmann <jan@gondor.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Oops in usb-storage.c
Date: Wed, 17 Oct 2001 03:11:13 +0200 [thread overview]
Message-ID: <20011017031113.A3072@gondor.com> (raw)
In-Reply-To: <20011017005822.A2161@gondor.com> <20011016175640.A18541@one-eyed-alien.net>
In-Reply-To: <20011016175640.A18541@one-eyed-alien.net>
On Tue, Oct 16, 2001 at 05:56:40PM -0700, Matthew Dharm wrote:
> Actually, this is a side-effect of another problem, which is that INQUIRY
> is legal for a device at any time (at least, to SCSI). What we really need
> to do is fake an INQURIY response for detached devices, separate from also
> those devices which need a faked-inquiry all the time.
Ok, then the fix could look like the following, I think. The INQUIRY
response in the disconnected case is a little bit different, as the
information from pusb_dev is not available, but the INQUIRY works and
the oops is fixed.
Jan
--- linux-2.4.12-ac3/drivers/usb/storage/usb.c.orig Mon Oct 1 12:15:29 2001
+++ linux-2.4.12-ac3/drivers/usb/storage/usb.c Wed Oct 17 03:04:32 2001
@@ -268,10 +268,12 @@
memcpy(data+16, us->unusual_dev->productName,
strlen(us->unusual_dev->productName) > 16 ? 16 :
strlen(us->unusual_dev->productName));
- data[32] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice>>12) & 0x0F);
- data[33] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice>>8) & 0x0F);
- data[34] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice>>4) & 0x0F);
- data[35] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice) & 0x0F);
+ if(us->pusb_dev) {
+ data[32] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice>>12) & 0x0F);
+ data[33] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice>>8) & 0x0F);
+ data[34] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice>>4) & 0x0F);
+ data[35] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice) & 0x0F);
+ }
if (us->srb->use_sg) {
sg = (struct scatterlist *)us->srb->request_buffer;
next prev parent reply other threads:[~2001-10-17 1:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-16 22:58 [PATCH] Oops in usb-storage.c Jan Niehusmann
2001-10-17 0:56 ` Matthew Dharm
2001-10-17 1:11 ` Jan Niehusmann [this message]
2001-10-17 1:32 ` Matthew Dharm
2001-10-17 1:44 ` Jan Niehusmann
2001-10-17 6:24 ` Matthew Dharm
2001-10-17 10:42 ` Jan Niehusmann
2001-10-17 19:15 ` Matthew Dharm
2001-10-17 21:03 ` Jan Niehusmann
2001-10-18 19:06 ` Jan Niehusmann
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=20011017031113.A3072@gondor.com \
--to=jan@gondor.com \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.