]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvme: Add error check for xa_store in nvme_get_effects_log
authorKeisuke Nishimura <keisuke.nishimura@inria.fr>
Fri, 20 Dec 2024 12:00:47 +0000 (13:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:49:51 +0000 (12:49 +0100)
commit8714ecb8fa5520c9cc0aec7e240e79943326f7aa
tree541a969ad6ea2fa46b729823bf07fe7ac16f1291
parent113563188f22274e7c56013db3d206bfa09e4da5
nvme: Add error check for xa_store in nvme_get_effects_log

[ Upstream commit ac32057acc7f3d7a238dafaa9b2aa2bc9750080e ]

The xa_store() may fail due to memory allocation failure because there
is no guarantee that the index csi is already used. This fix adds an
error check of the return value of xa_store() in nvme_get_effects_log().

Fixes: 1cf7a12e09aa ("nvme: use an xarray to lookup the Commands Supported and Effects log")
Signed-off-by: Keisuke Nishimura <keisuke.nishimura@inria.fr>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/core.c