summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDhaval Patel <pdhaval@codeaurora.org>2015-09-14 17:29:44 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:46:14 -0700
commit4341a02cccc0ddf571904da4b5f55366663ae8d1 (patch)
tree275e0cbbb4946fcda8d858a8ffd52fc667f131b5
parentac512d61b762412c88cc43950f0184e5209ad905 (diff)
msm: mdss: fix cdm init error check in interface API
CDM block allocation failure returns error pointer. Invalid check allows interface API to setup the block and invalid memory access. This change fixes the check for HDMI and WB interface. Change-Id: Ib18b3db81fb5154bc1d19c11fc372da8babd4121 Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_intf_video.c2
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_intf_writeback.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c
index 736f2cf5b1f4..6d56afeaac0b 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c
@@ -1366,7 +1366,7 @@ static int mdss_mdp_video_ctx_setup(struct mdss_mdp_ctl *ctl,
if (mdss_mdp_is_cdm_supported(mdata, ctl->intf_type, 0)) {
ctl->cdm = mdss_mdp_cdm_init(ctl, MDP_CDM_CDWN_OUTPUT_HDMI);
- if (ctl->cdm) {
+ if (!IS_ERR_OR_NULL(ctl->cdm)) {
if (mdss_mdp_video_cdm_setup(ctl->cdm, pinfo)) {
pr_err("%s: setting up cdm failed\n",
__func__);
diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_writeback.c b/drivers/video/fbdev/msm/mdss_mdp_intf_writeback.c
index 4d8daeeea056..3afd2e57dfbf 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_intf_writeback.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_intf_writeback.c
@@ -848,7 +848,7 @@ int mdss_mdp_writeback_start(struct mdss_mdp_ctl *ctl)
if (mdss_mdp_is_cdm_supported(ctl->mdata, ctl->intf_type,
mixer_type)) {
ctl->cdm = mdss_mdp_cdm_init(ctl, MDP_CDM_CDWN_OUTPUT_WB);
- if (!ctl->cdm) {
+ if (IS_ERR_OR_NULL(ctl->cdm)) {
pr_err("%s failed to init cdm\n", __func__);
return -EBUSY;
}