msm: mdss: prevent crash in null commit use case

Prevent client from crashing system when wfd_pre_commit is called
without calling validate before.

Change-Id: I83a2b878b300fb835908e57037da8a4d83d114ed
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
[cip@codeaurora.org: Resolved merge conflict]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
This commit is contained in:
Terence Hampson 2015-05-22 19:23:24 -04:00 committed by David Keitel
parent 4e60bcd430
commit 75c3748493

View file

@ -236,8 +236,8 @@ static int __layer_param_check(struct msm_fb_data_type *mfd,
}
if (CHECK_LAYER_BOUNDS(layer->dst_rect.y, layer->dst_rect.h, yres)) {
pr_err("invalid vertical destination: y=%d, h=%d\n",
layer->dst_rect.y, layer->dst_rect.h);
pr_err("invalid vertical destination: y=%d, h=%d, yres=%d\n",
layer->dst_rect.y, layer->dst_rect.h, yres);
return -EOVERFLOW;
}
@ -1446,6 +1446,12 @@ int mdss_mdp_layer_pre_commit_wfd(struct msm_fb_data_type *mfd,
goto fence_get_err;
}
}
} else {
wfd = mdp5_data->wfd;
if (!wfd->ctl || !wfd->ctl->wb) {
pr_err("wfd commit with null out layer and no validate\n");
return -EINVAL;
}
}
rc = mdss_mdp_layer_pre_commit(mfd, file, commit);