Commit 249b9f33 authored by roel kluin's avatar roel kluin Committed by Pekka Enberg

slab: unsigned slabp->inuse cannot be less than 0

unsigned slabp->inuse cannot be less than 0

Acked-by: Christoph Lameter <cl@linux-foundation.org
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
parent e9beef18
...@@ -2997,7 +2997,7 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags) ...@@ -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 * there must be at least one object available for
* allocation. * allocation.
*/ */
BUG_ON(slabp->inuse < 0 || slabp->inuse >= cachep->num); BUG_ON(slabp->inuse >= cachep->num);
while (slabp->inuse < cachep->num && batchcount--) { while (slabp->inuse < cachep->num && batchcount--) {
STATS_INC_ALLOCED(cachep); STATS_INC_ALLOCED(cachep);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment