summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2006-11-07 23:06:00 +0000
committermjacob <mjacob@FreeBSD.org>2006-11-07 23:06:00 +0000
commit41f89c348bccb68aec44d4c526916085b97334f5 (patch)
tree2b6bac07beb9d450a21c8592246e5c6586761c44 /sys/cam
parent085fc40080a3091cca7a42b7d2753bdfdd133968 (diff)
downloadFreeBSD-src-41f89c348bccb68aec44d4c526916085b97334f5.zip
FreeBSD-src-41f89c348bccb68aec44d4c526916085b97334f5.tar.gz
XPT_GET_TRAN_SETTINGS can fail- so check for an error and
don't blindly assume it succeeded.
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_xpt.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index b745fd6..a999c2f 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -1607,6 +1607,9 @@ xpt_announce_periph(struct cam_periph *periph, char *announce_string)
cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
cts.type = CTS_TYPE_CURRENT_SETTINGS;
xpt_action((union ccb*)&cts);
+ if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+ return;
+ }
/* Ask the SIM for its base transfer speed */
xpt_setup_ccb(&cpi.ccb_h, path, /*priority*/1);
@@ -5835,6 +5838,9 @@ proberequestdefaultnegotiation(struct cam_periph *periph)
cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
cts.type = CTS_TYPE_USER_SETTINGS;
xpt_action((union ccb *)&cts);
+ if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+ return;
+ }
cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
cts.type = CTS_TYPE_CURRENT_SETTINGS;
xpt_action((union ccb *)&cts);
@@ -6356,7 +6362,9 @@ xpt_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device,
cur_cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
cur_cts.type = cts->type;
xpt_action((union ccb *)&cur_cts);
-
+ if ((cur_cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+ return;
+ }
cur_scsi = &cur_cts.proto_specific.scsi;
if ((scsi->valid & CTS_SCSI_VALID_TQ) == 0) {
scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB;
OpenPOWER on IntegriCloud