test_report_supported_opcodes_rctd: Fix a NULL pointer dereference
Avoid that the test tool crashes due to a NULL pointer dereference if unmarshalling the Data-In buffer fails. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This commit is contained in:
committed by
Ronnie Sahlberg
parent
6d6cb515fb
commit
4591a82209
@@ -70,6 +70,8 @@ test_report_supported_opcodes_rctd(void)
|
||||
logging(LOG_VERBOSE, "Unmarshall the DATA-IN buffer");
|
||||
rsoc = scsi_datain_unmarshall(rso_task);
|
||||
CU_ASSERT_NOT_EQUAL(rsoc, NULL);
|
||||
if (!rsoc)
|
||||
goto free_task;
|
||||
|
||||
logging(LOG_VERBOSE, "Verify that all returned command descriptors "
|
||||
"have a timeout description");
|
||||
@@ -94,5 +96,6 @@ test_report_supported_opcodes_rctd(void)
|
||||
}
|
||||
}
|
||||
|
||||
free_task:
|
||||
scsi_free_scsi_task(rso_task);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user