summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasey Piper <cpiper@codeaurora.org>2013-10-03 17:22:54 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:21:58 -0700
commit2c9982241ccf0e3cc1f293a8d77797ce42970e60 (patch)
tree365317c285106d8ef119c25cfedd9ec8ba2f245b
parentfb140ff0070946c4fdbfc6fa2d6c12ac30c329c9 (diff)
msm: mdss: Account for null ctl passed to line count
Line count could be passed a null ctl structure, which would cause a kernel panic. To prevent this, line count will just return 0 if a null parameter is passed. Change-Id: I2b52533e6b67b842542de5b81be5b43fccc364dc CRs-Fixed: 551701 Signed-off-by: Casey Piper <cpiper@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_intf_video.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c
index 6901fcc23891..1b260a4126a5 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c
@@ -78,11 +78,15 @@ static inline u32 mdp_video_read(struct mdss_mdp_video_ctx *ctx,
static inline u32 mdss_mdp_video_line_count(struct mdss_mdp_ctl *ctl)
{
- struct mdss_mdp_video_ctx *ctx = ctl->priv_data;
+ struct mdss_mdp_video_ctx *ctx;
u32 line_cnt = 0;
+ if (!ctl || !ctl->priv_data)
+ goto line_count_exit;
+ ctx = ctl->priv_data;
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON, false);
line_cnt = mdp_video_read(ctx, MDSS_MDP_REG_INTF_LINE_COUNT);
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false);
+line_count_exit:
return line_cnt;
}