summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-07-14 04:01:28 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-07-14 04:01:28 -0700
commiteaea16f0b2155f39cb14aef60aeb91a3cf0e1c1d (patch)
tree06476f1f86cec83963d0a4e63cd0dc2061973435
parenta189faf3657d9c5c27a55f593bc7a0de7a067e20 (diff)
parentd191752dd921a82deef2d3c7516d10f3c4d3bc03 (diff)
Merge "fbdev: msm: Add check for fence count"
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_layer.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_layer.c b/drivers/video/fbdev/msm/mdss_mdp_layer.c
index e44edb8fbea7..3ccc09d58480 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_layer.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_layer.c
@@ -3131,6 +3131,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);