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

Commit 53894583 authored by Ingrid Gallardo's avatar Ingrid Gallardo Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: fix to return error when overlay get/set fail



Current calls to OVERLAY_SET and OVERLAY_GET ioctl are
not returning an error if the ioctl call fails since
the error gets overwritten by another function call.
Correcting this issue by preventing the return value
to get overwritten in case of failure.

Change-Id: I5d54ffdcdb86aa5d6521547bd40638dc4deb03da
Signed-off-by: default avatarIngrid Gallardo <ingridg@codeaurora.org>
parent 2b860e5c
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -2659,11 +2659,15 @@ int mdss_compat_overlay_ioctl(struct fb_info *info, unsigned int cmd,
		}
		ov32 = compat_ptr(arg);
		ret = __from_user_mdp_overlay(ov, ov32);
		if (ret)

		if (ret) {
			pr_err("%s: compat mdp overlay failed\n", __func__);
		else
		} else {
			ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) ov);

			if (!ret)
				ret = __to_user_mdp_overlay(ov32, ov);
		}
		break;
	case MSMFB_OVERLAY_SET:
		ov = compat_alloc_user_space(sizeof(*ov));
@@ -2678,6 +2682,8 @@ int mdss_compat_overlay_ioctl(struct fb_info *info, unsigned int cmd,
			pr_err("%s: compat mdp overlay failed\n", __func__);
		} else {
			ret = mdss_fb_do_ioctl(info, cmd, (unsigned long) ov);

			if (!ret)
				ret = __to_user_mdp_overlay(ov32, ov);
		}
		break;