diff options
Diffstat (limited to 'sys/dev/pv/hvs.c')
-rw-r--r-- | sys/dev/pv/hvs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pv/hvs.c b/sys/dev/pv/hvs.c index 271d7270455..0d5e6523561 100644 --- a/sys/dev/pv/hvs.c +++ b/sys/dev/pv/hvs.c @@ -590,7 +590,8 @@ fixup_inquiry(struct scsi_xfer *xs, struct hvs_srb *srb) int datalen, resplen; char vendor[8]; - resplen = srb->srb_datalen >= 5 ? inq->additional_length + 5 : 0; + resplen = srb->srb_datalen >= SID_SCSI2_HDRLEN ? + SID_SCSI2_HDRLEN + inq->additional_length : 0; datalen = MIN(resplen, srb->srb_datalen); /* Fixup wrong response from WS2012 */ @@ -601,7 +602,7 @@ fixup_inquiry(struct scsi_xfer *xs, struct hvs_srb *srb) (inq->version == 0 || inq->response_format == 0)) { inq->version = SCSI_REV_SPC3; inq->response_format = SID_SCSI2_RESPONSE; - } else if (datalen >= SID_INQUIRY_HDR + SID_SCSI2_ALEN) { + } else if (datalen >= SID_SCSI2_HDRLEN + SID_SCSI2_ALEN) { /* * Upgrade SPC2 to SPC3 if host is Win8 or WS2012 R2 * to support UNMAP feature. |