diff options
| author | Casey Piper <cpiper@codeaurora.org> | 2013-10-03 16:02:34 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:21:57 -0700 |
| commit | 282163f58b940a7925dadce44ffc2bf911000856 (patch) | |
| tree | 0b58ad414f3edefce1ed9a266ca6dc42915c23df | |
| parent | d3f10f093aebd9cd36b0bb30d31af034288928c8 (diff) | |
msm: mdss: Validate mixer/ctl are not null
mdss_mdp_wb_mixer_destroy could theoretically be
called with null mixer or ctl, which would cause
a null pointer dereference. Adding a check to
prevent this from happening.
Change-Id: I376c449daf05c8ca4ebb789d402575598ee59d86
CRs-Fixed: 551787
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_ctl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c index b792a098aa4d..85e7b3f09ecb 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c +++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c @@ -590,6 +590,11 @@ int mdss_mdp_wb_mixer_destroy(struct mdss_mdp_mixer *mixer) { struct mdss_mdp_ctl *ctl; + if (!mixer || !mixer->ctl) { + pr_err("invalid ctl handle\n"); + return -ENODEV; + } + ctl = mixer->ctl; mixer->rotator_mode = 0; |
