X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fbuddy.c;h=26a70212ba590e85aeea87a4fd27271a6c060af8;hb=0b2115047303e779be8578e9802cfa55d1767c7b;hp=43247b67ed13c0378f01838eaaa934719811810f;hpb=ae17be15b87687b72162680b335d64b741d0bb6b;p=palacios.git diff --git a/linux_module/buddy.c b/linux_module/buddy.c index 43247b6..26a7021 100644 --- a/linux_module/buddy.c +++ b/linux_module/buddy.c @@ -155,7 +155,7 @@ int buddy_add_pool(struct buddy_memzone * zone, mp = palacios_alloc_extended(sizeof(struct buddy_mempool), GFP_KERNEL, zone->node_id); - if (IS_ERR(mp)) { + if (!mp) { ERROR("Could not allocate mempool\n"); return -1; } @@ -174,6 +174,13 @@ int buddy_add_pool(struct buddy_memzone * zone, BITS_TO_LONGS(mp->num_blocks) * sizeof(long), GFP_KERNEL, zone->node_id ); + if (!(mp->tag_bits)) { + ERROR("Could not allocate tag_bits\n"); + palacios_free(mp); + return -1; + } + + /* Initially mark all minimum-sized blocks as allocated */ bitmap_zero(mp->tag_bits, mp->num_blocks);