video: tegra: host: fix integer overflow
authorDeepak Nibade <dnibade@nvidia.com>
Mon, 27 Jun 2016 08:43:26 +0000 (13:43 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Wed, 27 Jul 2016 11:50:09 +0000 (04:50 -0700)
commit3fae9674f9fc01f4fbdc9cffa3e88899f9e6a923
tree05173906df302ebbb3cd08a2eb10170c2637b846
parentd0542f962dbebe197c1b08bf0ab9b1128207404a
video: tegra: host: fix integer overflow

Below addition on 32 bit architecture machines could
cause integer overflow since we will assign overflowed
value to "num_unpins"
s64 num_unpins = num_cmdbufs + num_relocs

Fix this and other calculations by explicitly typecasting
variables to u64 first

Bug 1781393

Change-Id: Ib7d9c0be4ac61dc404512b4bb0331aa20a6978bc
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1171748
(cherry picked from commit 8f00b96c137b9c4cb43a8dbe2e153fae49524113)
Reviewed-on: http://git-master/r/1190752
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
drivers/video/tegra/host/nvhost_job.c