summaryrefslogtreecommitdiffstats
path: root/sys/cam/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r--sys/cam/scsi/scsi_cd.c11
-rw-r--r--sys/cam/scsi/scsi_xpt.c7
2 files changed, 8 insertions, 10 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index c1951ff..91384b7 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -687,6 +687,10 @@ cdregister(struct cam_periph *periph, void *arg)
else
softc->minimum_command_size = 6;
+ /*
+ * Refcount and block open attempts until we are setup
+ * Can't block
+ */
(void)cam_periph_hold(periph, PRIBIO);
cam_periph_unlock(periph);
/*
@@ -747,7 +751,6 @@ cdregister(struct cam_periph *periph, void *arg)
softc->disk->d_hba_subdevice = cpi.hba_subdevice;
disk_create(softc->disk, DISK_VERSION);
cam_periph_lock(periph);
- cam_periph_unhold(periph);
/*
* Add an async callback so that we get
@@ -972,12 +975,6 @@ cdregister(struct cam_periph *periph, void *arg)
cdregisterexit:
- /*
- * Refcount and block open attempts until we are setup
- * Can't block
- */
- (void)cam_periph_hold(periph, PRIBIO);
-
if ((softc->flags & CD_FLAG_CHANGER) == 0)
xpt_schedule(periph, CAM_PRIORITY_DEV);
else
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