blktests nvme 041,042 leak memory

Keith Busch kbusch at kernel.org
Thu May 30 09:29:47 PDT 2024


On Thu, May 30, 2024 at 09:25:24AM +0200, Maurizio Lombardi wrote:
> ct 30. 5. 2024 v 8:59 odesílatel Sagi Grimberg <sagi at grimberg.me> napsal:
> >
> >
> > Lets just do that... and add a comment that we don't want to add
> > function calls that can fail post cdev_device_add() because we have a
> > cleanup problem (with a short explanation), so this is less likely to
> > come back...
> >
> 
> Solution 1 will work even if it's not 100% perfect because after
> calling device_initialize()
> you're supposed to use put_device() to release the instance and not
> free the dev directly.
> 
> (The nvme_put_ctrl() call in the error path just releases the
> additional reference taken
> by nvme_get_ctrl() just before the call to cdev_device_add()).

I noticed that too, if cdev_dev_add() fails we are supposed to do a
put_device. This driver seems to be making it difficult to use the core
device interfaces as intended.



More information about the Linux-nvme mailing list