Patch "nvme: fix bogus kzalloc() return check in nvme_init_effects_log()" has been added to the 6.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

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

to the 6.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nvme-fix-bogus-kzalloc-return-check-in-nvme_init_eff.patch
and it can be found in the queue-6.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f41faa379beb225f916587af83f5804b0a7953c2
Author: Jens Axboe <axboe@xxxxxxxxx>
Date:   Mon Jan 13 10:27:54 2025 -0700

    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@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 7c4a19f5c951a..12e7ae1f99e20 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);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux