Got rid of assert() in drive.c by soft means

This commit is contained in:
2006-10-07 12:29:22 +00:00
parent 91f2a231f3
commit ff0be0eeae
9 changed files with 198 additions and 70 deletions

View File

@ -450,6 +450,15 @@ static void enumerate_common(char *fname, int bus_no, int host_no,
out.idata->valid = 0;
out.mdata = malloc(sizeof(struct scsi_mode_data));
out.mdata->valid = 0;
/* ts A61007 : obsolete assert() in drive_getcaps() */
if(out.idata == NULL || out.mdata == NULL) {
libdax_msgs_submit(libdax_messenger, -1, 0x00020108,
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
"Could not allocate new drive object", 0, 0);
return;
}
memset(&out.params, 0, sizeof(struct params));
t = burn_drive_register(&out);