msm: mdss: check for ctl path before handling commit
In case of failures during overlay kickoff, ctl may be destroyed. Need to ensure we check for availability before dereferencing. Change-Id: I32ead416ac10467b5bf1085d959794078f870db5 Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
This commit is contained in:
parent
d554932e06
commit
4f5551fde5
1 changed files with 6 additions and 0 deletions
|
@ -1472,6 +1472,9 @@ int mdss_mdp_overlay_kickoff(struct msm_fb_data_type *mfd,
|
|||
struct mdss_mdp_commit_cb commit_cb;
|
||||
LIST_HEAD(destroy_pipes);
|
||||
|
||||
if (!ctl)
|
||||
return -ENODEV;
|
||||
|
||||
ATRACE_BEGIN(__func__);
|
||||
if (ctl->shared_lock) {
|
||||
mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_BEGIN);
|
||||
|
@ -3315,6 +3318,9 @@ static int __handle_ioctl_overlay_prepare(struct msm_fb_data_type *mfd,
|
|||
struct mdp_overlay *overlays;
|
||||
int i, ret;
|
||||
|
||||
if (!mfd_to_ctl(mfd))
|
||||
return -ENODEV;
|
||||
|
||||
if (copy_from_user(&ovlist, argp, sizeof(ovlist)))
|
||||
return -EFAULT;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue