Dont free the scsi task from iscsi_scsi_command_async(), leave that for the caller to do if required.

This commit is contained in:
Ronnie Sahlberg
2011-02-25 15:53:56 +11:00
parent 356a6571bb
commit bdbf6b5d00
-4
View File
@@ -167,7 +167,6 @@ iscsi_send_data_out(struct iscsi_context *iscsi, struct iscsi_pdu *cmd_pdu,
return 0; return 0;
} }
int int
iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun, iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun,
struct scsi_task *task, iscsi_command_cb cb, struct scsi_task *task, iscsi_command_cb cb,
@@ -186,14 +185,12 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun,
if (iscsi->session_type != ISCSI_SESSION_NORMAL) { if (iscsi->session_type != ISCSI_SESSION_NORMAL) {
iscsi_set_error(iscsi, "Trying to send command on " iscsi_set_error(iscsi, "Trying to send command on "
"discovery session."); "discovery session.");
scsi_free_scsi_task(task);
return -1; return -1;
} }
if (iscsi->is_loggedin == 0) { if (iscsi->is_loggedin == 0) {
iscsi_set_error(iscsi, "Trying to send command while " iscsi_set_error(iscsi, "Trying to send command while "
"not logged in."); "not logged in.");
scsi_free_scsi_task(task);
return -1; return -1;
} }
@@ -201,7 +198,6 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun,
if (scsi_cbdata == NULL) { if (scsi_cbdata == NULL) {
iscsi_set_error(iscsi, "Out-of-memory: failed to allocate " iscsi_set_error(iscsi, "Out-of-memory: failed to allocate "
"scsi cbdata."); "scsi cbdata.");
scsi_free_scsi_task(task);
return -1; return -1;
} }
memset(scsi_cbdata, 0, sizeof(struct iscsi_scsi_cbdata)); memset(scsi_cbdata, 0, sizeof(struct iscsi_scsi_cbdata));