nvmet: fix error return code in nvmet_file_ns_enable()
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 31 May 2018 11:41:30 +0000 (11:41 +0000)
committerChristoph Hellwig <hch@lst.de>
Thu, 31 May 2018 16:46:46 +0000 (18:46 +0200)
commit1367bc82858018fd1a5a81b8fad4628e7163d1bf
treea56ba69f7fd73ceb73a6cdca58c2dbaa01e77184
parent81cf54e01a3d2eb47bee78a7579fc4dd0912f347
nvmet: fix error return code in nvmet_file_ns_enable()

Fix to return error code -ENOMEM from the memory alloc fail error
handling case instead of 0, as done elsewhere in this function.

Fixes: d5eff33ee6f8 ("nvmet: add simple file backed ns support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.e>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/io-cmd-file.c