From 7a86f369594a0b6567820b77d441e778e6adb8a7 Mon Sep 17 00:00:00 2001 From: Rajkumar Subbiah Date: Mon, 15 May 2017 15:17:14 -0400 Subject: [PATCH] msm: mdss: Fix potential dereferencing of null pointer During atomic commit on a writeback panel, there is a possibility of deferencing a NULL pointer if the configuration changes before the commit. This change adds a NULL pointer check to avoid it. Bug: 36731152 Change-Id: I56d0efad40992b6f87c81e5eab93cf0f24f6f524 Signed-off-by: Rajkumar Subbiah --- drivers/video/msm/mdss/mdss_fb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c index 86f380e8a845b..8e02cbf782e0f 100644 --- a/drivers/video/msm/mdss/mdss_fb.c +++ b/drivers/video/msm/mdss/mdss_fb.c @@ -3302,6 +3302,10 @@ int mdss_fb_atomic_commit(struct fb_info *info, MSMFB_ATOMIC_COMMIT, true, false); if (mfd->panel.type == WRITEBACK_PANEL) { output_layer = commit_v1->output_layer; + if (!output_layer) { + pr_err("Output layer is null\n"); + goto end; + } wb_change = !mdss_fb_is_wb_config_same(mfd, commit_v1->output_layer); if (wb_change) {