diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-04-15 09:35:24 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-04-15 09:36:16 +0200 |
commit | b257c14ceb1194a6181144210056d38f22127189 (patch) | |
tree | c803925f1d5bf2237e7495d306bf43929df0c952 /mm/slab.c | |
parent | 371fd7e7a56a5c136d31aa980011bd2f131c3ef5 (diff) | |
parent | 2ba3abd8186f24c7fb418927025b4e2120e3a362 (diff) | |
download | linux-3.10-b257c14ceb1194a6181144210056d38f22127189.tar.gz linux-3.10-b257c14ceb1194a6181144210056d38f22127189.tar.bz2 linux-3.10-b257c14ceb1194a6181144210056d38f22127189.zip |
Merge branch 'linus' into sched/core
Merge reason: merge the latest fixes, update to -rc4.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/mm/slab.c b/mm/slab.c index a9f325b28be..bac0f4fcc21 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -3602,21 +3602,10 @@ EXPORT_SYMBOL(kmem_cache_alloc_notrace); */ int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr) { - unsigned long addr = (unsigned long)ptr; - unsigned long min_addr = PAGE_OFFSET; - unsigned long align_mask = BYTES_PER_WORD - 1; unsigned long size = cachep->buffer_size; struct page *page; - if (unlikely(addr < min_addr)) - goto out; - if (unlikely(addr > (unsigned long)high_memory - size)) - goto out; - if (unlikely(addr & align_mask)) - goto out; - if (unlikely(!kern_addr_valid(addr))) - goto out; - if (unlikely(!kern_addr_valid(addr + size - 1))) + if (unlikely(!kern_ptr_validate(ptr, size))) goto out; page = virt_to_page(ptr); if (unlikely(!PageSlab(page))) |