Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373741
b: refs/heads/master
c: 6286ae9
h: refs/heads/master
i:
  373739: 2e8b521
v: v3
  • Loading branch information
Christoph Lameter authored and Pekka Enberg committed May 6, 2013
1 parent d543e05 commit 28a6361
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 14e50c6a9bc2b283bb4021026226268312ceefdd
refs/heads/master: 6286ae97d10ea2b5cd90532163797ab217bfdbdf
6 changes: 6 additions & 0 deletions trunk/include/linux/slab_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags)
if (!size)
return ZERO_SIZE_PTR;

if (WARN_ON_ONCE(size > KMALLOC_MAX_SIZE))
return NULL;

i = kmalloc_index(size);

#ifdef CONFIG_ZONE_DMA
Expand Down Expand Up @@ -172,6 +175,9 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
if (!size)
return ZERO_SIZE_PTR;

if (WARN_ON_ONCE(size > KMALLOC_MAX_SIZE))
return NULL;

i = kmalloc_index(size);

#ifdef CONFIG_ZONE_DMA
Expand Down
3 changes: 3 additions & 0 deletions trunk/mm/slab_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,9 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags)
{
int index;

if (WARN_ON_ONCE(size > KMALLOC_MAX_SIZE))
return NULL;

if (size <= 192) {
if (!size)
return ZERO_SIZE_PTR;
Expand Down

0 comments on commit 28a6361

Please sign in to comment.