Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cfc2629 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: qmi: Remove txn idr entry in qmi handle release"

parents 01833940 4fe9d5d9
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -353,8 +353,12 @@ int qmi_txn_wait(struct qmi_txn *txn, unsigned long timeout)

	ret = wait_for_completion_timeout(&txn->completion, timeout);

	if (txn->result == -ENETRESET)
	mutex_lock(&txn->lock);
	if (txn->result == -ENETRESET) {
		mutex_unlock(&txn->lock);
		return txn->result;
	}
	mutex_unlock(&txn->lock);

	mutex_lock(&qmi->txn_lock);
	mutex_lock(&txn->lock);
@@ -712,8 +716,11 @@ void qmi_handle_release(struct qmi_handle *qmi)

	mutex_lock(&qmi->txn_lock);
	idr_for_each_entry(&qmi->txns, txn, txn_id) {
		mutex_lock(&txn->lock);
		idr_remove(&qmi->txns, txn->id);
		txn->result = -ENETRESET;
		complete(&txn->completion);
		mutex_unlock(&txn->lock);
	}
	mutex_unlock(&qmi->txn_lock);
	idr_destroy(&qmi->txns);