android_kernel_samsung_sm8650/drivers/nvme
Maurizio Lombardi 84ea5242b7 nvme: clear the request_queue pointers on failure in nvme_alloc_admin_tag_set
[ Upstream commit fd62678ab55cb01e11a404d302cdade222bf4022 ]

If nvme_alloc_admin_tag_set() fails, the admin_q and fabrics_q pointers
are left with an invalid, non-NULL value. Other functions may then check
the pointers and dereference them, e.g. in

  nvme_probe() -> out_disable: -> nvme_dev_remove_admin().

Fix the bug by setting admin_q and fabrics_q to NULL in case of error.

Also use the set variable to free the tag_set as ctrl->admin_tagset isn't
initialized yet.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-02-22 12:59:44 +01:00
..
common treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
host nvme: clear the request_queue pointers on failure in nvme_alloc_admin_tag_set 2023-02-22 12:59:44 +01:00
target nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association 2023-02-22 12:59:44 +01:00
Kconfig nvme: implement In-Band authentication 2022-08-02 17:14:49 -06:00
Makefile nvme: implement In-Band authentication 2022-08-02 17:14:49 -06:00