If scsi_cdb_persistent_reserve_out() succeeds a call to scsi_free_scsi_task() won't free any memory allocated with scsi_malloc() in this function because the memset() call in this function overwrites the task->mem pointer. Move the memset() call up such that it doesn't clear task->mem. This makes it possible for the caller of this function to free the memory allocated by this function by calling scsi_free_scsi_task(). Merge the error handling code such that the code for freeing memory only occurs once. Signed-off-by: Bart Van Assche <bvanassche@acm.org>
95 KiB
95 KiB