Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309708
b: refs/heads/master
c: a3860c1
h: refs/heads/master
v: v3
  • Loading branch information
Xi Wang authored and Linus Torvalds committed Jun 1, 2012
1 parent 28abc10 commit 332eb97
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 15837294d4ce717f69942f7366e99d4d1d3d9923
refs/heads/master: a3860c1c5dd1137db23d7786d284939c5761d517
2 changes: 1 addition & 1 deletion trunk/fs/ceph/snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static int build_snap_context(struct ceph_snap_realm *realm)

/* alloc new snap context */
err = -ENOMEM;
if (num > (ULONG_MAX - sizeof(*snapc)) / sizeof(u64))
if (num > (SIZE_MAX - sizeof(*snapc)) / sizeof(u64))
goto fail;
snapc = kzalloc(sizeof(*snapc) + num*sizeof(u64), GFP_NOFS);
if (!snapc)
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/drm/drm_mem_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

static __inline__ void *drm_calloc_large(size_t nmemb, size_t size)
{
if (size != 0 && nmemb > ULONG_MAX / size)
if (size != 0 && nmemb > SIZE_MAX / size)
return NULL;

if (size * nmemb <= PAGE_SIZE)
Expand All @@ -44,7 +44,7 @@ static __inline__ void *drm_calloc_large(size_t nmemb, size_t size)
/* Modeled after cairo's malloc_ab, it's like calloc but without the zeroing. */
static __inline__ void *drm_malloc_ab(size_t nmemb, size_t size)
{
if (size != 0 && nmemb > ULONG_MAX / size)
if (size != 0 && nmemb > SIZE_MAX / size)
return NULL;

if (size * nmemb <= PAGE_SIZE)
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#define LLONG_MAX ((long long)(~0ULL>>1))
#define LLONG_MIN (-LLONG_MAX - 1)
#define ULLONG_MAX (~0ULL)
#define SIZE_MAX (~(size_t)0)

#define STACK_MAGIC 0xdeadbeef

Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ size_t ksize(const void *);
*/
static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
{
if (size != 0 && n > ULONG_MAX / size)
if (size != 0 && n > SIZE_MAX / size)
return NULL;
return __kmalloc(n * size, flags);
}
Expand Down

0 comments on commit 332eb97

Please sign in to comment.