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

Commit 909b1fdc authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "interconnect: qcom: Prevent duplicate BCMs being added to commit list"

parents 5202070c f1441eef
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -211,6 +211,7 @@ void qcom_icc_bcm_voter_add(struct bcm_voter *voter, struct qcom_icc_bcm *bcm)
		return;
		return;


	mutex_lock(&voter->lock);
	mutex_lock(&voter->lock);
	if (list_empty(&bcm->list))
		list_add_tail(&bcm->list, &voter->commit_list);
		list_add_tail(&bcm->list, &voter->commit_list);


	if (list_empty(&bcm->ws_list))
	if (list_empty(&bcm->ws_list))
@@ -280,6 +281,9 @@ int qcom_icc_bcm_voter_commit(struct bcm_voter *voter)
		goto out;
		goto out;
	}
	}


	list_for_each_entry_safe(bcm, bcm_tmp, &voter->commit_list, list)
		list_del_init(&bcm->list);

	INIT_LIST_HEAD(&voter->commit_list);
	INIT_LIST_HEAD(&voter->commit_list);


	list_for_each_entry_safe(bcm, bcm_tmp, &voter->ws_list, ws_list) {
	list_for_each_entry_safe(bcm, bcm_tmp, &voter->ws_list, ws_list) {
@@ -322,6 +326,9 @@ int qcom_icc_bcm_voter_commit(struct bcm_voter *voter)
	}
	}


out:
out:
	list_for_each_entry_safe(bcm, bcm_tmp, &voter->commit_list, list)
		list_del_init(&bcm->list);

	INIT_LIST_HEAD(&voter->commit_list);
	INIT_LIST_HEAD(&voter->commit_list);
	mutex_unlock(&voter->lock);
	mutex_unlock(&voter->lock);
	return ret;
	return ret;