Skip to content

Commit 170e086

Browse files
committed
nvme: fix bogus kzalloc() return check in nvme_init_effects_log()
nvme_init_effects_log() returns failure when kzalloc() is successful, which is obviously wrong and causes failures to boot. Correct the check. Fixes: d4a95ad ("nvme: Add error path for xa_store in nvme_init_effects") Signed-off-by: Jens Axboe <[email protected]>
1 parent e494e45 commit 170e086

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/host/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3182,7 +3182,7 @@ static int nvme_init_effects_log(struct nvme_ctrl *ctrl,
31823182
struct nvme_effects_log *effects, *old;
31833183

31843184
effects = kzalloc(sizeof(*effects), GFP_KERNEL);
3185-
if (effects)
3185+
if (!effects)
31863186
return -ENOMEM;
31873187

31883188
old = xa_store(&ctrl->cels, csi, effects, GFP_KERNEL);

0 commit comments

Comments
 (0)