scsi/ut: initialize task with invalid values to assert change later

Originally task was memset to 0, meaning that some asserts might have
incorrectly asserted values that were set to 0 beforehand.

Now ut_init_task() sets task to 0xFF, with only couple required fields set to
appropriate values.

Change-Id: I47fbb03daf6ab7cbf60abc58f63315a151e49890
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/417686
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Tomasz Zawadzki 2018-07-03 05:05:28 -04:00 committed by Jim Harris
parent a8656d66db
commit 97154b1f82

View File

@ -146,9 +146,12 @@ ut_put_task(struct spdk_scsi_task *task)
static void
ut_init_task(struct spdk_scsi_task *task)
{
memset(task, 0, sizeof(*task));
memset(task, 0xFF, sizeof(*task));
task->iov.iov_base = NULL;
task->iovs = &task->iov;
task->iovcnt = 1;
task->alloc_len = 0;
task->dxfer_dir = SPDK_SCSI_DIR_NONE;
}
void