[PATCH v2 08/15] nvmet-fcloop: add missing fcloop_callback_host_done

From: Daniel Wagner
Date: Tue Mar 11 2025 - 06:13:26 EST


Add the missing fcloop_call_host_done calls so that the caller
frees resources when something goes wrong.

Signed-off-by: Daniel Wagner <wagi@xxxxxxxxxx>
---
drivers/nvme/target/fcloop.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c
index 4ba75f7f51e0bd95ab806b6e82452e75593ff0cf..e6d9474f72c8c9f17b544e4d63039fd33f820db6 100644
--- a/drivers/nvme/target/fcloop.c
+++ b/drivers/nvme/target/fcloop.c
@@ -969,9 +969,11 @@ fcloop_fcp_abort(struct nvme_fc_local_port *localport,
}
spin_unlock(&inireq->inilock);

- if (!tfcp_req)
+ if (!tfcp_req) {
/* abort has already been called */
+ fcloop_call_host_done(fcpreq, tfcp_req, -ECANCELED);
return;
+ }

/* break initiator/target relationship for io */
spin_lock_irqsave(&tfcp_req->reqlock, flags);
@@ -985,6 +987,7 @@ fcloop_fcp_abort(struct nvme_fc_local_port *localport,
break;
default:
spin_unlock_irqrestore(&tfcp_req->reqlock, flags);
+ fcloop_call_host_done(fcpreq, tfcp_req, -ECANCELED);
WARN_ON(1);
return;
}

--
2.48.1