diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2018-09-28 05:48:49 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-09-28 05:48:49 -0700 |
| commit | ff19c63f48a388e1d7e9d5a6483000805c7d3fe7 (patch) | |
| tree | d06a06456530f49e0044e8b42c3e88babeb330a8 /drivers/video/fbdev | |
| parent | e3f184e82e277830b0a71169a48c9c022ffdbec7 (diff) | |
| parent | b7f83f8788c460c2c31c6d8ccc4907b621ead846 (diff) | |
Merge "mdss: mdp: Fix fudge factor overflow check"
Diffstat (limited to 'drivers/video/fbdev')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_ctl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c index ec56bcf6e64e..8cbe32940887 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c +++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c @@ -77,13 +77,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; |
