summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJayant Shekhar <jshekhar@codeaurora.org>2015-12-04 12:06:55 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:13:16 -0700
commit1b10409872b970f241e42ca2d68676ca554ab897 (patch)
tree82623183e16f5c15b2c6780b9f73388f80903d70
parent5843838a49a5dde0a0ea17e91bc75d9f54ae909d (diff)
msm: mdss: Fix potential NULL pointer dereference in misr set
If control setup is not done and if userspace calls misr set via metadata ioctl, then there can be a potential NULL pointer deference as mixer might be NULL. Add a check to validate if mixer is not NULL. Change-Id: I92f5778788cfcce6fa01a038b4321222a8804f28 Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_debug.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/video/fbdev/msm/mdss_debug.c b/drivers/video/fbdev/msm/mdss_debug.c
index 8076ab2fc8e8..8eaeb33e2448 100644
--- a/drivers/video/fbdev/msm/mdss_debug.c
+++ b/drivers/video/fbdev/msm/mdss_debug.c
@@ -1244,10 +1244,13 @@ static inline struct mdss_mdp_misr_map *mdss_misr_get_map(u32 block_id,
if (ctl) {
mixer = mdss_mdp_mixer_get(ctl,
MDSS_MDP_MIXER_MUX_DEFAULT);
- ctrl_reg = mixer->base +
- MDSS_MDP_LAYER_MIXER_MISR_CTRL;
- value_reg = mixer->base +
+
+ if (mixer) {
+ ctrl_reg = mixer->base +
+ MDSS_MDP_LAYER_MIXER_MISR_CTRL;
+ value_reg = mixer->base +
MDSS_MDP_LAYER_MIXER_MISR_SIGNATURE;
+ }
}
} else {
if (block_id <= DISPLAY_MISR_HDMI) {