cxl: fix leak of ctx->irq_bitmap when releasing context via kernel API
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Wed, 30 Sep 2015 01:58:06 +0000 (11:58 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 1 Oct 2015 01:49:32 +0000 (11:49 +1000)
commit52adee580d3c71a0dfabc3168597421981d68b86
tree6473ccee43f1d3b83226df14ef00a2c3adf9910e
parent8dde152ea34860403c839598bdef3f07239eb25a
cxl: fix leak of ctx->irq_bitmap when releasing context via kernel API

At present, ctx->irq_bitmap is freed in afu_release_irqs(), which is called
from afu_release() via cxl_context_detach().

Move the freeing of ctx->irq_bitmap from afu_release_irqs() to
reclaim_ctx() (called through cxl_context_free()) so it's freed when
releasing a context via the kernel API (cxl_release_context()) or the
userspace API (afu_release()).

Reported-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Fixes: 6f7f0b3df6d4 ("cxl: Add AFU virtual PHB and kernel API")
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/misc/cxl/context.c
drivers/misc/cxl/irq.c