summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Salido-Moreno <adrianm@codeaurora.org>2012-11-14 21:46:10 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:13:19 -0700
commitdce8e7e2fa1b3b798fec90c49672bb5ad422f38d (patch)
tree468eaff0b66863085752139211cca6ad686ed276
parent56f340e5b5f89363fc77c2d986b34e649b666868 (diff)
msm: mdss: fix possible null dereference of fb index
Rotator data paths don't have a fb device assigned, assuming that it will contains a reference to fd data is incorrect. Add check to avoid NULL pointer dereference. Change-Id: Ib91e96ddc56590f2f681673b162921191e3d86da Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_ctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c
index 7096545ae959..04773199b0f2 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c
@@ -992,7 +992,7 @@ int mdss_mdp_get_ctl_mixers(u32 fb_num, u32 *mixer_id)
mutex_lock(&mdss_mdp_ctl_lock);
for (i = 0; i < MDSS_MDP_MAX_CTL; i++) {
ctl = &mdss_mdp_ctl_list[i];
- if ((ctl->power_on) &&
+ if ((ctl->power_on) && (ctl->mfd) &&
(ctl->mfd->index == fb_num)) {
if (ctl->mixer_left) {
mixer_id[mixer_cnt] = ctl->mixer_left->num;