# Re: \[PATCH 06/13\] nvdimm/blk: avoid calling del\_gendisk() on early failures

- From: Luis Chamberlain \<mcgrof@kernel.org\>
- Date: 2021-10-19 16:07:21 
- List: linux-block
- Page: https://ratatoskr.run/linux-block/2021/10/1547360
- Thread: https://ratatoskr.run/linux-block/2021/10/1543973/t.md

```text
On Fri, Oct 15, 2021 at 05:13:48PM -0700, Dan Williams wrote:
> On Fri, Oct 15, 2021 at 4:53 PM Luis Chamberlain [ref] wrote:
> >
> > If nd_integrity_init() fails we'd get del_gendisk() called,
> > but that's not correct as we should only call that if we're
> > done with device_add_disk(). Fix this by providing unwinding
> > prior to the devm call being registered and moving the devm
> > registration to the very end.
> >
> > This should fix calling del_gendisk() if nd_integrity_init()
> > fails. I only spotted this issue through code inspection. It
> > does not fix any real world bug.
> >
> 
> Just fyi, I'm preparing patches to delete this driver completely as it
> is unused by any shipping platform. I hope to get that removal into
> v5.16.

I'll remove this from my queue, any chance you can review the changes
for nvdimm/btt?

  Luis
```
