summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>2000-04-02 07:49:09 +0000
committerken <ken@FreeBSD.org>2000-04-02 07:49:09 +0000
commita5c26270f36c7a99c239b5a4ef841e26a4c7c1ad (patch)
treef87ef1f150b8f74a3e3fde7e56fb825e00c11b31
parentd45e1e2b8b3d88e925564212283fb9072a911a32 (diff)
downloadFreeBSD-src-a5c26270f36c7a99c239b5a4ef841e26a4c7c1ad.zip
FreeBSD-src-a5c26270f36c7a99c239b5a4ef841e26a4c7c1ad.tar.gz
Fix two problems in the ch(4) driver.
- Mike Smith discovered a panic in the changer probe code if the probe command (mode sense) fails. So we need to release the CCB used in the probe before we unlock the peripheral. (i.e. the same fix mjacob put in the CD and DA drivers) - A newline was missing in a warning message. (PR kern/17512) PR: kern/17512 Submitted by: Louis Mamakos <louie@uu.net> (newline fix)
-rw-r--r--sys/cam/scsi/scsi_ch.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index 8c9e445..42b0694 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -688,8 +688,17 @@ chdone(struct cam_periph *periph, union ccb *done_ccb)
xpt_announce_periph(periph, announce_buf);
softc->state = CH_STATE_NORMAL;
free(mode_header, M_TEMP);
+ /*
+ * Since our peripheral may be invalidated by an error
+ * above or an external event, we must release our CCB
+ * before releasing the probe lock on the peripheral.
+ * The peripheral will only go away once the last lock
+ * is removed, and we need it around for the CCB release
+ * operation.
+ */
+ xpt_release_ccb(done_ccb);
cam_periph_unlock(periph);
- break;
+ return;
}
case CH_CCB_WAITING:
{
@@ -697,6 +706,8 @@ chdone(struct cam_periph *periph, union ccb *done_ccb)
wakeup(&done_ccb->ccb_h.cbfcnp);
return;
}
+ default:
+ break;
}
xpt_release_ccb(done_ccb);
}
@@ -1053,7 +1064,7 @@ copy_element_status(struct ch_softc *softc,
if (!(ces->ces_flags & CES_SOURCE_VALID))
printf("ch: warning: could not map element source "
- "address %ud to a valid element type",
+ "address %ud to a valid element type\n",
eaddr);
}
OpenPOWER on IntegriCloud