summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2001-07-04 05:22:42 +0000
committermjacob <mjacob@FreeBSD.org>2001-07-04 05:22:42 +0000
commitcf247593d5f1503da087ddc5ff6a02e88977b738 (patch)
treeb92f928965a577042eda4e2e0e98b9fdf6ddcea4 /sys/cam
parentd506b2b2f1707872a011c76f0e6b0786f8c1c3be (diff)
downloadFreeBSD-src-cf247593d5f1503da087ddc5ff6a02e88977b738.zip
FreeBSD-src-cf247593d5f1503da087ddc5ff6a02e88977b738.tar.gz
Check the void * argument in the AC_FOUND_DEV case against NULL. Whether
correctly or not, this sometimes is propagated up via XPT.
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_cd.c2
-rw-r--r--sys/cam/scsi/scsi_ch.c2
-rw-r--r--sys/cam/scsi/scsi_da.c4
-rw-r--r--sys/cam/scsi/scsi_pass.c2
-rw-r--r--sys/cam/scsi/scsi_pt.c2
-rw-r--r--sys/cam/scsi/scsi_sa.c2
-rw-r--r--sys/cam/scsi/scsi_ses.c3
7 files changed, 16 insertions, 1 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index 6c12ed2..ca6122c 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -505,6 +505,8 @@ cdasync(void *callback_arg, u_int32_t code,
cam_status status;
cgd = (struct ccb_getdev *)arg;
+ if (cgd == NULL)
+ break;
if (SID_TYPE(&cgd->inq_data) != T_CDROM
&& SID_TYPE(&cgd->inq_data) != T_WORM)
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index 9ec85c8..7d9bba3 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -325,6 +325,8 @@ chasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
cam_status status;
cgd = (struct ccb_getdev *)arg;
+ if (cgd == NULL)
+ break;
if (SID_TYPE(&cgd->inq_data)!= T_CHANGER)
break;
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index c1c9e30..5c705d5 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -894,6 +894,8 @@ daasync(void *callback_arg, u_int32_t code,
cam_status status;
cgd = (struct ccb_getdev *)arg;
+ if (cgd == NULL)
+ break;
if (SID_TYPE(&cgd->inq_data) != T_DIRECT
&& SID_TYPE(&cgd->inq_data) != T_OPTICAL)
@@ -1101,7 +1103,7 @@ dastart(struct cam_periph *periph, union ccb *start_ccb)
tag_code = MSG_SIMPLE_Q_TAG;
}
scsi_read_write(&start_ccb->csio,
- /*retries*/4,
+ /*retries*/4, /* retry a few times */
dadone,
tag_code,
bp->bio_cmd == BIO_READ,
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index 6dc25d4..c6ed554 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -237,6 +237,8 @@ passasync(void *callback_arg, u_int32_t code,
cam_status status;
cgd = (struct ccb_getdev *)arg;
+ if (cgd == NULL)
+ break;
/*
* Allocate a peripheral instance for
diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c
index a1fe607..0211d4d 100644
--- a/sys/cam/scsi/scsi_pt.c
+++ b/sys/cam/scsi/scsi_pt.c
@@ -446,6 +446,8 @@ ptasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
cam_status status;
cgd = (struct ccb_getdev *)arg;
+ if (cgd == NULL)
+ break;
if (SID_TYPE(&cgd->inq_data) != T_PROCESSOR)
break;
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index 91180ed..ae1ed57 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -1375,6 +1375,8 @@ saasync(void *callback_arg, u_int32_t code,
cam_status status;
cgd = (struct ccb_getdev *)arg;
+ if (cgd == NULL)
+ break;
if (SID_TYPE(&cgd->inq_data) != T_SEQUENTIAL)
break;
diff --git a/sys/cam/scsi/scsi_ses.c b/sys/cam/scsi/scsi_ses.c
index 75c41ba..635556e 100644
--- a/sys/cam/scsi/scsi_ses.c
+++ b/sys/cam/scsi/scsi_ses.c
@@ -288,6 +288,9 @@ sesasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
int inq_len;
cgd = (struct ccb_getdev *)arg;
+ if (arg == NULL) {
+ break;
+ }
inq_len = cgd->inq_data.additional_length + 4;
OpenPOWER on IntegriCloud