summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorBenjamin Chan <bkchan@codeaurora.org>2017-11-14 00:27:17 -0500
committerGerrit - the friendly Code Review server <code-review@localhost>2017-11-15 08:28:05 -0800
commit9b0c877cd12412f2d04d5ebd46bc49e7acd6ce97 (patch)
tree65895bfc37c491be2a6fdd60037b08a0ebec3ff2 /drivers/video
parentae2f6cb5ada42a3e3da6182ac3092007f5a319d8 (diff)
msm: mdss: adjust mdss_mdp_get_plane_sizes parameters init order
Parameter mdss_mdp_plane_sizes must be cleared to 0 before returning under an error condition, otherwise caller function will use the uninitialized mdss_mdp_plane_sizes values and caused incorrect operation. Change-Id: I856b17ce9e917cc450040463ec34b7309d34b9b5 Signed-off-by: Benjamin Chan <bkchan@codeaurora.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_util.c b/drivers/video/fbdev/msm/mdss_mdp_util.c
index 1ae3d0ba4ec6..6015ed20fe56 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_util.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_util.c
@@ -524,11 +524,12 @@ int mdss_mdp_get_plane_sizes(struct mdss_mdp_format_params *fmt, u32 w, u32 h,
if (ps == NULL)
return -EINVAL;
+ memset(ps, 0, sizeof(struct mdss_mdp_plane_sizes));
+
if ((w > MAX_IMG_WIDTH) || (h > MAX_IMG_HEIGHT))
return -ERANGE;
bpp = fmt->bpp;
- memset(ps, 0, sizeof(struct mdss_mdp_plane_sizes));
if (mdss_mdp_is_ubwc_format(fmt)) {
rc = mdss_mdp_get_ubwc_plane_size(fmt, w, h, ps);