Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33e2b5a2 authored by Jayant Shekhar's avatar Jayant Shekhar
Browse files

msm: mdss: Add NULL pointer checks in mdss_mdp_wb_set_secure



Null pointer dereference can cause kernel panic, hence add
checks to avoid them.

CRs-Fixed: 553552
Change-Id: Ia854d7b65a5cf6a0fa214c34e658ea0f1380ac2c
Signed-off-by: default avatarJayant Shekhar <jshekhar@codeaurora.org>
parent 14a5d3a3
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -142,6 +142,16 @@ int mdss_mdp_wb_set_secure(struct msm_fb_data_type *mfd, int enable)

	pr_debug("setting secure=%d\n", enable);

	if (!ctl || !ctl->mdata) {
		pr_err("%s : ctl is NULL", __func__);
		return -EINVAL;
	}

	if (!wb) {
		pr_err("unable to start, writeback is not initialized\n");
		return -ENODEV;
	}

	ctl->is_secure = enable;
	wb->is_secure = enable;