Check the void * argument in the AC_FOUND_DEV case against NULL. Whether

correctly or not, this sometimes is propagated up via XPT.
This commit is contained in:
mjacob 2001-07-04 05:22:42 +00:00
parent 9d2e63879d
commit 2be2b20986
7 changed files with 16 additions and 1 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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,

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;