__free_page(ctx->ff_page);
ctx->sstp = NULL;
- kfree(ctx->irq_bitmap);
+ bitmap_free(ctx->irq_bitmap);
/* Drop ref to the afu device taken during cxl_context_init */
cxl_afu_put(ctx->afu);
if (adapter->guest->irq_avail) {
for (i = 0; i < adapter->guest->irq_nranges; i++) {
cur = &adapter->guest->irq_avail[i];
- kfree(cur->bitmap);
+ bitmap_free(cur->bitmap);
}
kfree(adapter->guest->irq_avail);
}
}
ctx->irq_count = count;
- ctx->irq_bitmap = kcalloc(BITS_TO_LONGS(count),
- sizeof(*ctx->irq_bitmap), GFP_KERNEL);
+ ctx->irq_bitmap = bitmap_zalloc(count, GFP_KERNEL);
if (!ctx->irq_bitmap)
goto out;
cur = &adapter->guest->irq_avail[i];
cur->offset = be32_to_cpu(ranges[i * 2]);
cur->range = be32_to_cpu(ranges[i * 2 + 1]);
- cur->bitmap = kcalloc(BITS_TO_LONGS(cur->range),
- sizeof(*cur->bitmap), GFP_KERNEL);
+ cur->bitmap = bitmap_zalloc(cur->range, GFP_KERNEL);
if (cur->bitmap == NULL)
goto err;
if (cur->offset < adapter->guest->irq_base_offset)
err:
for (i--; i >= 0; i--) {
cur = &adapter->guest->irq_avail[i];
- kfree(cur->bitmap);
+ bitmap_free(cur->bitmap);
}
kfree(adapter->guest->irq_avail);
adapter->guest->irq_avail = NULL;