On Wed, Sep 01, 2021 at 03:41:47PM +0200, Geert Uytterhoeven wrote:
--- a/drivers/block/z2ram.c +++ b/drivers/block/z2ram.c @@ -333,8 +334,10 @@ static int z2ram_register_disk(int minor) sprintf(disk->disk_name, "z2ram"); z2ram_gendisk[minor] = disk; - add_disk(disk); - return 0; + err = add_disk(disk); + if (err) + blk_cleaup_disk(disk);blk_cleanup_disk()?
Fixed thanks. Luis