summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwill <will@FreeBSD.org>2011-06-22 22:55:51 +0000
committerwill <will@FreeBSD.org>2011-06-22 22:55:51 +0000
commit32b96d68087da77d33ebe05b2ff29b320276da71 (patch)
treefe792b639804ba96ba1d11dab0d62ebc1b3147ee
parentecea455f28b101465b759c50e88b60b57d4a9fba (diff)
downloadFreeBSD-src-32b96d68087da77d33ebe05b2ff29b320276da71.zip
FreeBSD-src-32b96d68087da77d33ebe05b2ff29b320276da71.tar.gz
Return CAM_REQ_INVALID if the SCSI XPT receives an unsupported operation
via the XPT_DEV_ADVINFO CCB. Reviewed by: ken
-rw-r--r--sys/cam/scsi/scsi_xpt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c
index 1b507ca..c1f713b 100644
--- a/sys/cam/scsi/scsi_xpt.c
+++ b/sys/cam/scsi/scsi_xpt.c
@@ -2440,12 +2440,13 @@ scsi_dev_advinfo(union ccb *start_ccb)
struct ccb_dev_advinfo *cdai;
off_t amt;
+ start_ccb->ccb_h.status = CAM_REQ_INVALID;
device = start_ccb->ccb_h.path->device;
cdai = &start_ccb->cdai;
switch(cdai->buftype) {
case CDAI_TYPE_SCSI_DEVID:
if (cdai->flags & CDAI_FLAG_STORE)
- break;
+ return;
cdai->provsiz = device->device_id_len;
if (device->device_id_len == 0)
break;
@@ -2456,7 +2457,7 @@ scsi_dev_advinfo(union ccb *start_ccb)
break;
case CDAI_TYPE_SERIAL_NUM:
if (cdai->flags & CDAI_FLAG_STORE)
- break;
+ return;
cdai->provsiz = device->serial_num_len;
if (device->serial_num_len == 0)
break;
@@ -2490,7 +2491,7 @@ scsi_dev_advinfo(union ccb *start_ccb)
}
break;
default:
- break;
+ return;
}
start_ccb->ccb_h.status = CAM_REQ_CMP;
OpenPOWER on IntegriCloud