diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-08-23 13:18:25 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2013-08-27 10:20:11 +0200 |
commit | f5fda676e9a3991aab159418f870351bc7d45d96 (patch) | |
tree | e2cd6626f446753b24f6c4d4f454ebe195a729c1 /drivers/gpu/host1x/debug.c | |
parent | ccaddfe1a2e10f50aa6f553f9791c2724b6d3c4a (diff) | |
download | kernel_goldelico_gta04-f5fda676e9a3991aab159418f870351bc7d45d96.zip kernel_goldelico_gta04-f5fda676e9a3991aab159418f870351bc7d45d96.tar.gz kernel_goldelico_gta04-f5fda676e9a3991aab159418f870351bc7d45d96.tar.bz2 |
gpu: host1x: fix an integer overflow check
Tegra is a 32 bit arch. On 32 bit systems then size_t is 32 bits so
"total" will never be higher than UINT_MAX because of integer overflows.
We need cast to u64 first before doing the math.
Also the addition earlier:
unsigned int num_unpins = num_cmdbufs + num_relocs;
That can overflow as well, but I think it's still safe because we check
both "num_cmdbufs" and "num_relocs" again in this test.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x/debug.c')
0 files changed, 0 insertions, 0 deletions