nvme: fix bogus kzalloc() return check in nvme_init_effects_log()

BugLink: https://bugs.launchpad.net/bugs/2111953

[ Upstream commit 170e086ad3997f816d1f551f178a03a626a130b7 ]

nvme_init_effects_log() returns failure when kzalloc() is successful,
which is obviously wrong and causes failures to boot. Correct the
check.

Fixes: d4a95adeabc6 ("nvme: Add error path for xa_store in nvme_init_effects")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com>
Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
This commit is contained in:
Jens Axboe
2025-01-13 10:27:54 -07:00
committed by Mehmet Basaran
parent ff1c701886
commit 8b2ce7d8f4
+1 -1
View File
@@ -3022,7 +3022,7 @@ static int nvme_init_effects_log(struct nvme_ctrl *ctrl,
struct nvme_effects_log *effects, *old;
effects = kzalloc(sizeof(*effects), GFP_KERNEL);
if (effects)
if (!effects)
return -ENOMEM;
old = xa_store(&ctrl->cels, csi, effects, GFP_KERNEL);