diff options
author | Ilan Aelion <iaelion@nvidia.com> | 2012-08-02 11:01:02 -0600 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-08-08 17:21:04 -0700 |
commit | 5d5af93396111aff2bb30e63279f1dfe4f95d962 (patch) | |
tree | 9d316465fc5fab2bc69f59d6edd5312c8fe40a3c /drivers/misc | |
parent | cd0b0f629c7709411600a944a72b06225a523bac (diff) |
misc: tegra-throughput: prevent division by 0
Prevent division by 0 on subsequent flip notifications at an interval
shorter than 1 micro-second.
Bug 1027664
Change-Id: I6e2f886721216fc2479adc1a24504b707c7ebe45
Signed-off-by: Ilan Aelion <iaelion@nvidia.com>
(cherry picked from commit 92807179cbbd60be67e09ff40bdaab313e3a55fe)
Reviewed-on: http://git-master/r/121142
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Donghan Ryu <dryu@nvidia.com>
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Michael I Gold <gold@nvidia.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/tegra-throughput.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/misc/tegra-throughput.c b/drivers/misc/tegra-throughput.c index b2375d2913bf..77eb7c31ed36 100644 --- a/drivers/misc/tegra-throughput.c +++ b/drivers/misc/tegra-throughput.c @@ -57,6 +57,9 @@ static int throughput_flip_notifier(struct notifier_block *nb, else last_frame_time = (unsigned short) timediff; + if (last_frame_time == 0) + return NOTIFY_DONE; + throughput_hint = ((int) target_frame_time * 100)/last_frame_time; |