video: tegra: host: fix integer overflow
authorDeepak Nibade <dnibade@nvidia.com>
Mon, 27 Jun 2016 08:43:26 +0000 (13:43 +0530)
committerWinnie Hsu <whsu@nvidia.com>
Fri, 29 Jul 2016 05:59:09 +0000 (22:59 -0700)
commit964ef1d4d2932f4d2dc1d97459f0d7026cdccffd
tree54d7c7e1ce233425636a7504e8003660dfc888fe
parentbc15da6c6fc2f50109e866fe053b035721a23c3a
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/1172519
(cherry picked from commit 61229625b1e19d5a93a9458f04e0cce356dbdee3)
Reviewed-on: http://git-master/r/1190218
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jeetesh Burman <jburman@nvidia.com>
Tested-by: Jeetesh Burman <jburman@nvidia.com>
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
drivers/video/tegra/host/nvhost_job.c