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

Commit 296f223c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Fix concurrency issues in bus voting"

parents 03cc3a28 b4d20c5e
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -186,13 +186,17 @@ int msm_comm_vote_bus(struct msm_vidc_core *core)
	hdev = core->device;

	mutex_lock(&core->lock);
	vote_data = core->vote_data;
	list_for_each_entry(inst, &core->instances, list)
		++vote_data_count;

	vote_data = kcalloc(vote_data_count, sizeof(*vote_data),
			GFP_TEMPORARY);
	vote_data_count = 0;
	if (!vote_data) {
		dprintk(VIDC_PROF,
			"Failed to get vote_data for inst %pK\n",
				inst);
		dprintk(VIDC_ERR, "%s: failed to allocate memory\n", __func__);
		mutex_unlock(&core->lock);
		return -EINVAL;
		rc = -ENOMEM;
		return rc;
	}

	list_for_each_entry(inst, &core->instances, list) {
@@ -305,6 +309,7 @@ int msm_comm_vote_bus(struct msm_vidc_core *core)
		rc = call_hfi_op(hdev, vote_bus, hdev->hfi_device_data,
			vote_data, vote_data_count);

	kfree(vote_data);
	return rc;
}