summary refs log tree commit diff
path: root/drivers/nvme
diff options
context:
space:
mode:
authorJoel Granados <j.granados@samsung.com>2022-11-02 18:17:08 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-12-31 13:32:11 +0100
commit18ef9434379b695442d778a8c7f1094ca170a7cb (patch)
tree26fba380ef952a628e696c3e010b4cc77e535040 /drivers/nvme
parent8084bd0a64e278314b733993f388d83a86aa1183 (diff)
downloadlinux-18ef9434379b695442d778a8c7f1094ca170a7cb.tar.gz
nvme: return err on nvme_init_non_mdts_limits fail
[ Upstream commit bcaf434b8f04e1ee82a8b1e1bce0de99fbff67fa ]

In nvme_init_non_mdts_limits function we were returning 0 when kzalloc
failed; it now returns -ENOMEM.

Fixes: 5befc7c26e5a ("nvme: implement non-mdts command limits")
Signed-off-by: Joel Granados <j.granados@samsung.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 7e3893d06bab..a4ea0607bc98 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3049,7 +3049,7 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
 
 	id = kzalloc(sizeof(*id), GFP_KERNEL);
 	if (!id)
-		return 0;
+		return -ENOMEM;
 
 	c.identify.opcode = nvme_admin_identify;
 	c.identify.cns = NVME_ID_CNS_CS_CTRL;