blktests nvme 041,042 leak memory

Maurizio Lombardi mlombard at redhat.com
Thu May 30 00:25:24 PDT 2024


čt 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()).

Maurizio




More information about the Linux-nvme mailing list