Commit ff38547d authored by Ziye Yang's avatar Ziye Yang Committed by Daniel Verkamp
Browse files

iSCSI: change return value of spdk_iscsi_conn_free_tasks



We need to return -1, when there is still tasks. From the
usage, return 1 is wrong.

Change-Id: Ibf1b53e0be92818c73590c0b4211d34332073c74
Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
parent 634786e5
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -420,16 +420,18 @@ static int spdk_iscsi_conn_free_tasks(struct spdk_iscsi_conn *conn)
	while (!TAILQ_EMPTY(&conn->write_pdu_list)) {
		pdu = TAILQ_FIRST(&conn->write_pdu_list);
		TAILQ_REMOVE(&conn->write_pdu_list, pdu, tailq);
		if (pdu->task)
		if (pdu->task) {
			spdk_iscsi_task_put(pdu->task);
		}
		spdk_put_pdu(pdu);
	}

	while (!TAILQ_EMPTY(&conn->snack_pdu_list)) {
		pdu = TAILQ_FIRST(&conn->snack_pdu_list);
		TAILQ_REMOVE(&conn->snack_pdu_list, pdu, tailq);
		if (pdu->task)
		if (pdu->task) {
			spdk_iscsi_task_put(pdu->task);
		}
		spdk_put_pdu(pdu);
	}

@@ -442,7 +444,7 @@ static int spdk_iscsi_conn_free_tasks(struct spdk_iscsi_conn *conn)
	}

	if (conn->pending_task_cnt)
		return 1;
		return -1;

	return 0;