nvme: put ns_head ref if namespace fails allocation
mainline inclusion from mainline-v5.1-rc1 commit a63b8370 category: bugfix bugzilla: NA CVE: NA Link: https://gitee.com/openeuler/kernel/issues/I1WGZE -------------------------------- In case nvme_alloc_ns fails after we initialize ns_head but before we add the ns to the controller namespaces list we need to explicitly put the ns_head reference because when we teardown the controller we won't find it, causing us to leak a dangling subsystem eventually. Signed-off-by:Sagi Grimberg <sagi@grimberg.me> Signed-off-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Jens Axboe <axboe@kernel.dk> Reviewed-by:
Chao Leng <lengchao@huawei.com> Reviewed-by:
Jike Cheng <chengjike.cheng@huawei.com> Signed-off-by:
Lijie <lijie34@huawei.com> Reviewed-by:
Tao Hou <houtao1@huawei.com> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com>
Loading
Please sign in to comment