Skip to content

Commit

Permalink
slub: Remove useless checks in alloc_debug_processing
Browse files Browse the repository at this point in the history
Alloc debug processing is never called with a NULL object pointer.
No reason to check for NULL.

Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
  • Loading branch information
Christoph Lameter committed Mar 3, 2008
1 parent e153362 commit d692ef6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ static int alloc_debug_processing(struct kmem_cache *s, struct page *page,
if (!check_slab(s, page))
goto bad;

if (object && !on_freelist(s, page, object)) {
if (!on_freelist(s, page, object)) {
object_err(s, page, object, "Object already allocated");
goto bad;
}
Expand All @@ -862,7 +862,7 @@ static int alloc_debug_processing(struct kmem_cache *s, struct page *page,
goto bad;
}

if (object && !check_object(s, page, object, 0))
if (!check_object(s, page, object, 0))
goto bad;

/* Success perform special debug activities for allocs */
Expand Down

0 comments on commit d692ef6

Please sign in to comment.