From bdbf6b5d002265b8efab9f6feba109f0a946c95c Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Fri, 25 Feb 2011 15:53:56 +1100 Subject: [PATCH] Dont free the scsi task from iscsi_scsi_command_async(), leave that for the caller to do if required. --- lib/scsi-command.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/scsi-command.c b/lib/scsi-command.c index 8b04faa..29436c2 100644 --- a/lib/scsi-command.c +++ b/lib/scsi-command.c @@ -167,7 +167,6 @@ iscsi_send_data_out(struct iscsi_context *iscsi, struct iscsi_pdu *cmd_pdu, return 0; } - int iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun, 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) { iscsi_set_error(iscsi, "Trying to send command on " "discovery session."); - scsi_free_scsi_task(task); return -1; } if (iscsi->is_loggedin == 0) { iscsi_set_error(iscsi, "Trying to send command while " "not logged in."); - scsi_free_scsi_task(task); return -1; } @@ -201,7 +198,6 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun, if (scsi_cbdata == NULL) { iscsi_set_error(iscsi, "Out-of-memory: failed to allocate " "scsi cbdata."); - scsi_free_scsi_task(task); return -1; } memset(scsi_cbdata, 0, sizeof(struct iscsi_scsi_cbdata));