From: Dan Carpenter Date: Fri, 23 Aug 2013 10:18:25 +0000 (+0300) Subject: gpu: host1x: fix an integer overflow check X-Git-Tag: v3.12-rc1~136^2~4^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5fda676e9a3991aab159418f870351bc7d45d96;p=pandora-kernel.git 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 Signed-off-by: Thierry Reding --- Reading git-diff-tree failed