Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 55279
b: refs/heads/master
c: abcd08a
h: refs/heads/master
i:
  55277: 9a70769
  55275: 82c573d
  55271: 87943a0
  55263: 425b849
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed May 9, 2007
1 parent 7435e57 commit 55b2304
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 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: a87615b8f9e2349f6d3770af3d72fd6a41ab4239
refs/heads/master: abcd08a6f564171ffa05bc77d1c2ba4cfa949653
13 changes: 3 additions & 10 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,8 @@ static int check_bytes(u8 *start, unsigned int value, unsigned int bytes)
return 1;
}


static int check_valid_pointer(struct kmem_cache *s, struct page *page,
void *object)
static inline int check_valid_pointer(struct kmem_cache *s,
struct page *page, const void *object)
{
void *base;

Expand Down Expand Up @@ -1796,13 +1795,7 @@ int kmem_ptr_validate(struct kmem_cache *s, const void *object)
/* No slab or wrong slab */
return 0;

addr = page_address(page);
if (object < addr || object >= addr + s->objects * s->size)
/* Out of bounds */
return 0;

if ((object - addr) % s->size)
/* Improperly aligned */
if (!check_valid_pointer(s, page, object))
return 0;

/*
Expand Down

0 comments on commit 55b2304

Please sign in to comment.