summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>2004-11-18 07:24:29 +0000
committergibbs <gibbs@FreeBSD.org>2004-11-18 07:24:29 +0000
commit6025687bd2f76d49e1b0a375355b3e4cb30c7b70 (patch)
tree9ae8499dd3f79e6541a20df756182c63387ba9f1 /sys/cam
parent72ebe7a7c1a9d6ca2d44182461b71d1b685584fd (diff)
downloadFreeBSD-src-6025687bd2f76d49e1b0a375355b3e4cb30c7b70.zip
FreeBSD-src-6025687bd2f76d49e1b0a375355b3e4cb30c7b70.tar.gz
Correct another location where inquiry length as calculated from the
inquiry additional length field is off by one. MFC: 3 days
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_xpt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index d0b5baf..4250aa4 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -5813,7 +5813,7 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
switch(periph_qual) {
case SID_QUAL_LU_CONNECTED:
{
- u_int8_t alen;
+ u_int8_t len;
/*
* We conservatively request only
@@ -5825,9 +5825,11 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
* the amount of information the device
* is willing to give.
*/
- alen = inq_buf->additional_length;
+ len = inq_buf->additional_length
+ + offsetof(struct scsi_inquiry_data,
+ additional_length) + 1;
if (softc->action == PROBE_INQUIRY
- && alen > (SHORT_INQUIRY_LENGTH - 4)) {
+ && len > SHORT_INQUIRY_LENGTH) {
softc->action = PROBE_FULL_INQUIRY;
xpt_release_ccb(done_ccb);
xpt_schedule(periph, priority);
OpenPOWER on IntegriCloud