summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaseer Ahmed <naseer@codeaurora.org>2017-01-11 15:15:02 -0500
committerNaseer Ahmed <naseer@codeaurora.org>2017-01-13 11:00:13 -0500
commit7cc7987034cece54e33899cee5d7064a77dbefd0 (patch)
tree150e3c193c50ce7e1bc17c5b9e31c4a1a363eb2d
parent2dc96b1cbbdcf5aef3780696708012d55fec57f2 (diff)
msm: mdss: Fix potential null pointer dereference
When resetting the mdp control there is a NULL check for left mixer before calling pipe reset but the NULL check for right mixer is missing causes a NULL pointer deferencing. This change adds the NULL check. Change-Id: Iebbc68c4016d8b13805187343eb7b657e8b76bcc Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_ctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c
index 5246e5d1166c..ad59d6d217fd 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -4575,7 +4575,8 @@ int mdss_mdp_ctl_reset(struct mdss_mdp_ctl *ctl, bool is_recovery)
if (mixer) {
mdss_mdp_pipe_reset(mixer, is_recovery);
- if (is_dual_lm_single_display(ctl->mfd))
+ if (is_dual_lm_single_display(ctl->mfd) &&
+ ctl->mixer_right)
mdss_mdp_pipe_reset(ctl->mixer_right, is_recovery);
}