summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/msm
diff options
context:
space:
mode:
authorJayant Shekhar <jshekhar@codeaurora.org>2016-04-01 14:37:53 +0530
committerJeevan Shriram <jshriram@codeaurora.org>2016-04-26 14:38:09 -0700
commit8f1887371a96cefc86784095cbf01cf13c8cc9b7 (patch)
tree8441e3be9795f8ce2d52eb68130f5dcefe549588 /drivers/video/fbdev/msm
parent44111e6548757e73fe2978002c99738b097b4bd4 (diff)
msm: mdss: Fix potential pipe NULL pointer dereference
NULL pointer derefernce can happen with variable pipe struct during pipe intialization. Fix this to add a check for NULL pointer. Change-Id: I3241ed89979deb777ca62d0c893afb96926820ee Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev/msm')
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_pipe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_pipe.c b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
index 44eded98e785..08db5424a178 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_pipe.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
@@ -1129,7 +1129,7 @@ static struct mdss_mdp_pipe *mdss_mdp_pipe_init(struct mdss_mdp_mixer *mixer,
for (i = off; i < npipes; i++) {
pipe = pipe_pool + i;
- if (atomic_read(&pipe->kref.refcount) == 0) {
+ if (pipe && atomic_read(&pipe->kref.refcount) == 0) {
pipe->mixer_left = mixer;
break;
}