From 7cc7987034cece54e33899cee5d7064a77dbefd0 Mon Sep 17 00:00:00 2001 From: Naseer Ahmed Date: Wed, 11 Jan 2017 15:15:02 -0500 Subject: 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 --- drivers/video/fbdev/msm/mdss_mdp_ctl.c | 5 +++-- 1 file 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); } -- cgit v1.2.3