Skip to contentSkip to conversation

nvme-fabrics: fix I/O connect error handling

PATCH Applied Chaitanya Kulkarni 2 participants 2 messages Feb 13, 2024 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 nvme-fabrics: fix I/O connect error handling

In nvmf_connect_io_queue(), if connect I/O command fails, we log the error and continue for authentication. This overrides error captured from __nvme_submit_sync_cmd(), causing wrong return value.

Add goto out_free_data after logging connect error to fix the issue.

Fixes f50fff73d620c ("nvme: implement In-Band authentication")

---
V2: add fixes tag (Christoph)

 drivers/nvme/host/fabrics.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvme/host/fabrics.c +1 -0
index 3499acbf6a82..495c171daead 100644
@@ -534,6 +534,7 @@ int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid)
 	if (ret) {
 		nvmf_log_connect_error(ctrl, ret, le32_to_cpu(res.u32),
 				       &cmd, data);
+		goto out_free_data;
 	}
 	result = le32_to_cpu(res.u32);
 	if (result & (NVME_CONNECT_AUTHREQ_ATR | NVME_CONNECT_AUTHREQ_ASCR)) {
Signature · 1 line
2.40.0
maintainer Applied
#1 lore raw
Quoted 8 lines · Chaitanya Kulkarni

In nvmf_connect_io_queue(), if connect I/O command fails, we log the error and continue for authentication. This overrides error captured from __nvme_submit_sync_cmd(), causing wrong return value.

Add goto out_free_data after logging connect error to fix the issue.

Fixes f50fff73d620c ("nvme: implement In-Band authentication")

Thanks, applied to nvme-6.8.