xa_init() runs before blk_alloc_disk(); on error the path called brd_free_device() without xa_destroy(), leaking the xarray state. Signed-off-by: Iván Ezequiel Rodriguez --- drivers/block/brd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/block/brd.c b/drivers/block/brd.c index 00cc8122068f..c18262295c39 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -346,6 +346,7 @@ static int brd_alloc(int i) out_cleanup_disk: put_disk(disk); out_free_dev: + xa_destroy(&brd->brd_pages); brd_free_device(brd); return err; } -- 2.43.0