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

Commit 515de738 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mdss: mdp: Fix fudge factor overflow check"

parents c0ec3008 b6c2cb12
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -76,13 +76,15 @@ static inline u64 fudge_factor(u64 val, u32 numer, u32 denom)
	u64 result = val;

	if (val) {
		u64 temp = -1UL;
		u64 temp = U64_MAX;

		do_div(temp, val);
		if (temp > numer) {
			/* no overflow, so we can do the operation*/
			result = (val * (u64)numer);
			do_div(result, denom);
		} else {
			pr_warn("Overflow, skip fudge factor\n");
		}
	}
	return result;