diff options
author | mav <mav@FreeBSD.org> | 2010-02-05 12:40:18 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2010-02-05 12:40:18 +0000 |
commit | 86ce93b08d3a49a8a55699832196588d16403b4f (patch) | |
tree | 04a93a6e7e75c2137f2c0585da5c04db5db9b3cc /sys/dev/ciss | |
parent | f6bab2156aa3fc07f06a388457925c6c1c6a69da (diff) | |
download | FreeBSD-src-86ce93b08d3a49a8a55699832196588d16403b4f.zip FreeBSD-src-86ce93b08d3a49a8a55699832196588d16403b4f.tar.gz |
When hacking INQUIRY result, make sure that it is right INQUIRY and there
is enough of result to hack.
Diffstat (limited to 'sys/dev/ciss')
-rw-r--r-- | sys/dev/ciss/ciss.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index f80a9ca..66a046d 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -3286,10 +3286,15 @@ ciss_cam_complete_fixup(struct ciss_softc *sc, struct ccb_scsiio *csio) { struct scsi_inquiry_data *inq; struct ciss_ldrive *cl; + uint8_t *cdb; int bus, target; - if (((csio->ccb_h.flags & CAM_CDB_POINTER) ? - *(u_int8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes[0]) == INQUIRY) { + cdb = (csio->ccb_h.flags & CAM_CDB_POINTER) ? + (uint8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes; + if (cdb[0] == INQUIRY && + (cdb[1] & SI_EVPD) == 0 && + (csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN && + csio->dxfer_len >= SHORT_INQUIRY_LENGTH) { inq = (struct scsi_inquiry_data *)csio->data_ptr; target = csio->ccb_h.target_id; |