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

Commit 71ba9f28 authored by Benjamin Chan's avatar Benjamin Chan Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarBenjamin Chan <bkchan@codeaurora.org>
parent ce9aab8f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -515,11 +515,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);