summaryrefslogtreecommitdiff
path: root/drivers/nvme
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2025-01-13 10:27:54 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-08 10:00:57 +0100
commitd011fdc5176b998076db728a12819ae654bb4493 (patch)
treef69771f922e69f3422068aa838c8c48240593262 /drivers/nvme
parentc5ff1fbdf06d16565298925f9eb9ecde36ee5fdd (diff)
nvme: fix bogus kzalloc() return check in nvme_init_effects_log()
[ 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>
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 7c4a19f5c951..12e7ae1f99e2 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3181,7 +3181,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);