summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShalabh Jain <shalabhj@codeaurora.org>2013-11-04 11:57:16 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:23:08 -0700
commitfc3e1adbaa8007fed24a72406ae41c10ed7be997 (patch)
tree5ada116da8a069d81eec9f31cb7e8e500da9295c
parent42c53b18dd85fe3251aabb836958befa8c59b953 (diff)
msm: mdss: Avoid variable overloading
A particular variable is overloaded and used in 2 different contexts. This causes overwriting of original value and leads to incorrect error handling. This code adds a new variable to avoid such condition. Change-Id: Ibd040e6b4ce95759cc0011304940365c70e6c12a Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_rotator.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_rotator.c b/drivers/video/fbdev/msm/mdss_mdp_rotator.c
index 78a09a1fbb64..857dde02f4db 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_rotator.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_rotator.c
@@ -203,7 +203,7 @@ static int mdss_mdp_rotator_queue_sub(struct mdss_mdp_rotator_session *rot,
struct mdss_mdp_data *dst_data)
{
struct mdss_mdp_pipe *rot_pipe = NULL;
- struct mdss_mdp_ctl *ctl;
+ struct mdss_mdp_ctl *orig_ctl, *rot_ctl;
int ret;
if (!rot || !rot->ref_cnt)
@@ -219,20 +219,20 @@ static int mdss_mdp_rotator_queue_sub(struct mdss_mdp_rotator_session *rot,
pr_debug("queue rotator pnum=%d\n", rot_pipe->num);
- ctl = rot_pipe->mixer->ctl;
- if (ctl->shared_lock)
- mutex_lock(ctl->shared_lock);
+ orig_ctl = rot_pipe->mixer->ctl;
+ if (orig_ctl->shared_lock)
+ mutex_lock(orig_ctl->shared_lock);
- ctl = mdss_mdp_ctl_mixer_switch(ctl,
+ rot_ctl = mdss_mdp_ctl_mixer_switch(orig_ctl,
MDSS_MDP_WB_CTL_TYPE_BLOCK);
- if (!ctl) {
+ if (!rot_ctl) {
ret = -EINVAL;
goto error;
} else {
- rot->pipe->mixer = ctl->mixer_left;
+ rot->pipe->mixer = rot_ctl->mixer_left;
}
- if (rot->params_changed || ctl->mdata->mixer_switched) {
+ if (rot->params_changed || rot_ctl->mdata->mixer_switched) {
rot->params_changed = 0;
rot_pipe->flags = rot->flags;
rot_pipe->src_fmt = mdss_mdp_get_format_params(rot->format);
@@ -258,12 +258,12 @@ static int mdss_mdp_rotator_queue_sub(struct mdss_mdp_rotator_session *rot,
goto error;
}
- ret = mdss_mdp_rotator_kickoff(ctl, rot, dst_data);
+ ret = mdss_mdp_rotator_kickoff(rot_ctl, rot, dst_data);
return ret;
error:
- if (ctl->shared_lock)
- mutex_unlock(ctl->shared_lock);
+ if (orig_ctl->shared_lock)
+ mutex_unlock(orig_ctl->shared_lock);
return ret;
}