Fix objcache get with unaligned object sizes
authorJack Miller <jack@codezen.org>
Fri, 22 Apr 2016 22:36:02 +0000 (17:36 -0500)
committerJack Miller <jack@codezen.org>
Sun, 24 Apr 2016 05:14:37 +0000 (00:14 -0500)
mm/objcache.c

index ef1d002..9df36bd 100644 (file)
@@ -58,7 +58,7 @@ static int __bitmap_overall_first_zero(struct objcache *objcache, void **retptr)
     while (cur) {
         ret = __bitmap_first_zero_in_page(bitmap_longs, cur);
 
-        if (ret >= 0) {
+        if (ret >= 0 && ret < OVERHEAD_BITS(objcache)) {
             *retptr = cur;
             return ret;
         }