aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorXi Wang <xi.wang@gmail.com>2012-05-31 16:26:04 -0700
committerBen Hutchings <ben@decadent.org.uk>2014-08-06 18:07:42 +0100
commitb11597b7041b76aa25855db6028fad853201c54e (patch)
tree42faf8759af6b96f5c67a17691ecd3d50223ec58 /mm
parentce4ded58d4b5869153cf5fde839161dff974cf94 (diff)
downloadkernel_samsung_smdk4412-b11597b7041b76aa25855db6028fad853201c54e.zip
kernel_samsung_smdk4412-b11597b7041b76aa25855db6028fad853201c54e.tar.gz
kernel_samsung_smdk4412-b11597b7041b76aa25855db6028fad853201c54e.tar.bz2
introduce SIZE_MAX
commit a3860c1c5dd1137db23d7786d284939c5761d517 upstream. ULONG_MAX is often used to check for integer overflow when calculating allocation size. While ULONG_MAX happens to work on most systems, there is no guarantee that `size_t' must be the same size as `long'. This patch introduces SIZE_MAX, the maximum value of `size_t', to improve portability and readability for allocation size validation. Signed-off-by: Xi Wang <xi.wang@gmail.com> Acked-by: Alex Elder <elder@dreamhost.com> Cc: David Airlie <airlied@linux.ie> Cc: Pekka Enberg <penberg@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions