Skip to content

Commit

Permalink
slab: unsigned slabp->inuse cannot be less than 0
Browse files Browse the repository at this point in the history
unsigned slabp->inuse cannot be less than 0

Acked-by: Christoph Lameter <cl@linux-foundation.org
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
  • Loading branch information
roel kluin authored and Pekka Enberg committed Nov 26, 2008
1 parent e9beef1 commit 249b9f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -2997,7 +2997,7 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags)
* there must be at least one object available for
* allocation.
*/
BUG_ON(slabp->inuse < 0 || slabp->inuse >= cachep->num);
BUG_ON(slabp->inuse >= cachep->num);

while (slabp->inuse < cachep->num && batchcount--) {
STATS_INC_ALLOCED(cachep);
Expand Down

0 comments on commit 249b9f3

Please sign in to comment.