nvme: Make nvme_uninit_ctrl symmetric to nvme_init_ctrl
mainline inclusion from mainline-v5.7-rc1 commit 726612b6 category: bugfix bugzilla: NA CVE: NA Link: https://gitee.com/openeuler/kernel/issues/I1WGZE -------------------------------- Put the ctrl reference count at nvme_uninit_ctrl as opposed to nvme_init_ctrl which takes it. This decrease the reference count at the core layer instead of decreasing it on each transport separately. Also move the call of nvme_uninit_ctrl at PCI driver after calling to nvme_release_prp_pools and nvme_dev_unmap, in order to put the reference count after using the dev. This is safe because those functions use nvme_dev which is freed only later at nvme_pci_free_ctrl. Signed-off-by: NIsrael Rukshin <israelr@mellanox.com> Reviewed-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NKeith Busch <kbusch@kernel.org> Conflicts: drivers/nvme/host/tcp.c drivers/nvme/host/core.c [No code about TCP in current version and adjust context.] Reviewed-by: NChao Leng <lengchao@huawei.com> Reviewed-by: NJike Cheng <chengjike.cheng@huawei.com> Signed-off-by: NLijie <lijie34@huawei.com> Reviewed-by: NHou Tao <houtao1@huawei.com> Acked-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
想要评论请 注册 或 登录