]> www.infradead.org Git - nvme.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)
committerKeith Busch <kbusch@kernel.org>
Sat, 11 Jan 2025 03:30:46 +0000 (19:30 -0800)
commitac32057acc7f3d7a238dafaa9b2aa2bc9750080e
treeab405442eec0d230a161b65e87a3679e506f919c
parent32193789878c259e39b97bd0c0f2f0ccbe5cb8a8
nvme: Add error check for xa_store in nvme_get_effects_log

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>
drivers/nvme/host/core.c