From: Max Gurtovoy <maxg@mellanox.com>
To: linux-nvme@lists.infradead.org, hch@lst.de, kbusch@kernel.org,
sagi@grimberg.me
Cc: Max Gurtovoy <maxg@mellanox.com>,
israelr@mellanox.com, james.smart@broadcom.com,
shlomin@mellanox.com
Subject: [PATCH 8/8] nvme-tcp: fix possible leakage during error flow
Date: Thu, 10 Oct 2019 16:28:20 +0300 [thread overview]
Message-ID: <1570714100-15520-9-git-send-email-maxg@mellanox.com> (raw)
In-Reply-To: <1570714100-15520-1-git-send-email-maxg@mellanox.com>
During nvme_tcp_setup_cmd_pdu error flow, one must call nvme_cleanup_cmd
since it's symmetric to nvme_setup_cmd.
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
---
drivers/nvme/host/tcp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 124fda6..0156350 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -2126,6 +2126,7 @@ static blk_status_t nvme_tcp_setup_cmd_pdu(struct nvme_ns *ns,
ret = nvme_tcp_map_data(queue, rq);
if (unlikely(ret)) {
+ nvme_cleanup_cmd(rq);
dev_err(queue->ctrl->ctrl.device,
"Failed to map data (%d)\n", ret);
return ret;
--
1.8.3.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2019-10-10 13:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 13:28 [PATCH 0/8] small NVMe cleanups/fixes Max Gurtovoy
2019-10-10 13:28 ` [PATCH 1/8] nvme: Introduce nvme_is_aen_req function Max Gurtovoy
2019-10-10 13:51 ` Christoph Hellwig
2019-10-10 13:28 ` [PATCH 2/8] nvmet: use bio_io_error instead of duplicating it Max Gurtovoy
2019-10-10 13:51 ` Christoph Hellwig
2019-10-10 13:28 ` [PATCH 3/8] nvmet: add unlikely check at nvmet_req_alloc_sgl Max Gurtovoy
2019-10-10 13:51 ` Christoph Hellwig
2019-10-10 15:27 ` Max Gurtovoy
2019-10-10 13:28 ` [PATCH 4/8] nvmet-rdma: add unlikely check at nvmet_rdma_map_sgl_keyed Max Gurtovoy
2019-10-10 13:28 ` [PATCH 5/8] nvme: introduce "Command Aborted By host" status code Max Gurtovoy
2019-10-10 13:53 ` Christoph Hellwig
2019-10-10 13:28 ` [PATCH 6/8] nvme: move common call to nvme_cleanup_cmd to core layer Max Gurtovoy
2019-10-10 13:56 ` Christoph Hellwig
2019-10-10 13:28 ` [PATCH 7/8] nvmet-loop: fix possible leakage during error flow Max Gurtovoy
2019-10-10 13:28 ` Max Gurtovoy [this message]
2019-10-10 13:56 ` [PATCH 8/8] nvme-tcp: " Christoph Hellwig
2019-10-13 16:57 [PATCH v2 0/8] small NVMe cleanups/fixes Max Gurtovoy
2019-10-13 16:57 ` [PATCH 8/8] nvme-tcp: fix possible leakage during error flow Max Gurtovoy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1570714100-15520-9-git-send-email-maxg@mellanox.com \
--to=maxg@mellanox.com \
--cc=hch@lst.de \
--cc=israelr@mellanox.com \
--cc=james.smart@broadcom.com \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
--cc=shlomin@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).