Re: [PATCH 01/15] z2ram: add error handling support for add_disk()

From: Luis Chamberlain
Date: Wed Sep 01 2021 - 15:41:43 EST


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