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

Commit 430f3805 authored by Krishna Manikandan's avatar Krishna Manikandan
Browse files

msm: mdss: Add check for fence count



Add a check to ensure that the acquire fence count
does not exceed the maximum possible value.

Change-Id: I7198899be2d720214152d49fdbb6b6a69750fb3a
Signed-off-by: default avatarKrishna Manikandan <mkrishn@codeaurora.org>
parent 9f54d28c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2234,6 +2234,14 @@ int mdss_mdp_layer_pre_commit_wfd(struct msm_fb_data_type *mfd,
		sync_pt_data = &mfd->mdp_sync_pt_data;
		mutex_lock(&sync_pt_data->sync_mutex);
		count = sync_pt_data->acq_fen_cnt;

		if (count >= MDP_MAX_FENCE_FD) {
			pr_err("Reached maximum possible value for fence count\n");
			mutex_unlock(&sync_pt_data->sync_mutex);
			rc = -EINVAL;
			goto input_layer_err;
		}

		sync_pt_data->acq_fen[count] = fence;
		sync_pt_data->acq_fen_cnt++;
		mutex_unlock(&sync_pt_data->sync_mutex);