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

Commit c39fa52d authored by Dhaval Patel's avatar Dhaval Patel
Browse files

mdss: mdp: prevent null pointer dereference in mixer width calculation



Frame buffer releases all allocated control nodes by calling
blank when its reference count reaches to zero. In error
case, caller might call prepare ioctl and lead to null
pointer dereference to calculate the layer mixer width. A null
condition check prevents such dereferencing call.

CRs-fixed: 664517
Change-Id: I3b65b48a67ab2efb9654457ca7901da6ef0d57be
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent d3e85426
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ static inline bool is_ov_right_blend(struct mdp_rect *left_blend,
static inline u32 left_lm_w_from_mfd(struct msm_fb_data_type *mfd)
{
	struct mdss_mdp_ctl *ctl = mfd_to_ctl(mfd);
	return ctl->mixer_left->width;
	return (ctl && ctl->mixer_left) ? ctl->mixer_left->width : 0;
}

static int mdss_mdp_overlay_sd_ctrl(struct msm_fb_data_type *mfd,