aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe JAILLET <[email protected]>2022-07-11 21:14:48 +0200
committerGreg Kroah-Hartman <[email protected]>2022-07-14 16:53:52 +0200
commit3a15b45b5454da862376b5d69a4967f5c6fa1368 (patch)
treea5dc498d38cd773fb8c72df51e87f750823486f5
parent4b00b176b3a3bcd4679487c23d333be02e533d93 (diff)
cxl: Fix a memory leak in an error handling path
A bitmap_zalloc() must be balanced by a corresponding bitmap_free() in the error handling path of afu_allocate_irqs(). Acked-by: Andrew Donnellan <[email protected]> Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/ce5869418f5838187946eb6b11a52715a93ece3d.1657566849.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/misc/cxl/irq.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c
index 0ce91d99aead..b730e022a48e 100644
--- a/drivers/misc/cxl/irq.c
+++ b/drivers/misc/cxl/irq.c
@@ -349,6 +349,7 @@ int afu_allocate_irqs(struct cxl_context *ctx, u32 count)
out:
cxl_ops->release_irq_ranges(&ctx->irqs, ctx->afu->adapter);
+ bitmap_free(ctx->irq_bitmap);
afu_irq_name_free(ctx);
return -ENOMEM;
}