1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

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:
Matt Jacob 2001-07-04 05:22:42 +00:00
parent d99b6ac2d7
commit c5ff3b2fed
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79177
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; cam_status status;
cgd = (struct ccb_getdev *)arg; cgd = (struct ccb_getdev *)arg;
if (cgd == NULL)
break;
if (SID_TYPE(&cgd->inq_data) != T_CDROM if (SID_TYPE(&cgd->inq_data) != T_CDROM
&& SID_TYPE(&cgd->inq_data) != T_WORM) && 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; cam_status status;
cgd = (struct ccb_getdev *)arg; cgd = (struct ccb_getdev *)arg;
if (cgd == NULL)
break;
if (SID_TYPE(&cgd->inq_data)!= T_CHANGER) if (SID_TYPE(&cgd->inq_data)!= T_CHANGER)
break; break;

View File

@ -894,6 +894,8 @@ daasync(void *callback_arg, u_int32_t code,
cam_status status; cam_status status;
cgd = (struct ccb_getdev *)arg; cgd = (struct ccb_getdev *)arg;
if (cgd == NULL)
break;
if (SID_TYPE(&cgd->inq_data) != T_DIRECT if (SID_TYPE(&cgd->inq_data) != T_DIRECT
&& SID_TYPE(&cgd->inq_data) != T_OPTICAL) && 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; tag_code = MSG_SIMPLE_Q_TAG;
} }
scsi_read_write(&start_ccb->csio, scsi_read_write(&start_ccb->csio,
/*retries*/4, /*retries*/4, /* retry a few times */
dadone, dadone,
tag_code, tag_code,
bp->bio_cmd == BIO_READ, bp->bio_cmd == BIO_READ,

View File

@ -237,6 +237,8 @@ passasync(void *callback_arg, u_int32_t code,
cam_status status; cam_status status;
cgd = (struct ccb_getdev *)arg; cgd = (struct ccb_getdev *)arg;
if (cgd == NULL)
break;
/* /*
* Allocate a peripheral instance for * 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; cam_status status;
cgd = (struct ccb_getdev *)arg; cgd = (struct ccb_getdev *)arg;
if (cgd == NULL)
break;
if (SID_TYPE(&cgd->inq_data) != T_PROCESSOR) if (SID_TYPE(&cgd->inq_data) != T_PROCESSOR)
break; break;

View File

@ -1375,6 +1375,8 @@ saasync(void *callback_arg, u_int32_t code,
cam_status status; cam_status status;
cgd = (struct ccb_getdev *)arg; cgd = (struct ccb_getdev *)arg;
if (cgd == NULL)
break;
if (SID_TYPE(&cgd->inq_data) != T_SEQUENTIAL) if (SID_TYPE(&cgd->inq_data) != T_SEQUENTIAL)
break; break;

View File

@ -288,6 +288,9 @@ sesasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
int inq_len; int inq_len;
cgd = (struct ccb_getdev *)arg; cgd = (struct ccb_getdev *)arg;
if (arg == NULL) {
break;
}
inq_len = cgd->inq_data.additional_length + 4; inq_len = cgd->inq_data.additional_length + 4;