From 802c82f9d2b5f8d1a534fb61e3fc78641e42cb48 Mon Sep 17 00:00:00 2001 From: James Smart Date: Tue, 20 Apr 2021 19:46:44 +0800 Subject: [PATCH] nvme-fc: fix error loop in create_hw_io_queues mainline inclusion from mainline-5.10 commit 514a6dc9ecfd2fe4e1deebcb7a63e3de23e6c38b category: bugfix bugzilla: NA CVE: NA ------------------------------------------------- The loop that backs out of hw io queue creation continues through index 0, which corresponds to the admin queue as well. Fix the loop so it only proceeds through indexes 1..n which correspond to I/O queues. Signed-off-by: James Smart Reviewed-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Wenchao Hao Reviewed-by: Miaohe Lin Signed-off-by: Yang Yingliang --- drivers/nvme/host/fc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index d7ce961f7686..e4baa9e578f1 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -1953,7 +1953,7 @@ nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize) return 0; delete_queues: - for (; i >= 0; i--) + for (; i > 0; i--) __nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[i], i); return ret; } @@ -2071,7 +2071,7 @@ nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg) return; dev_warn(ctrl->ctrl.device, - "NVME-FC{%d}: transport association error detected: %s\n", + "NVME-FC{%d}: transport association event: %s\n", ctrl->cnum, errmsg); dev_warn(ctrl->ctrl.device, "NVME-FC{%d}: resetting controller\n", ctrl->cnum); -- GitLab