diff options
author | Max Gurtovoy <maxg@mellanox.com> | 2019-10-13 19:57:38 +0300 |
---|---|---|
committer | Keith Busch <kbusch@kernel.org> | 2019-10-15 16:47:29 +0300 |
commit | 28a4cac48c7e897a0b4e7d79a53a8e4fe40337ae (patch) | |
tree | fdfd9d5ef2bcc7b40dc34324d2f92593fb9b1f49 | |
parent | 5812d04c4c7455627d8722e04ab99a737cfe9713 (diff) | |
download | linux-28a4cac48c7e897a0b4e7d79a53a8e4fe40337ae.tar.xz |
nvme-tcp: fix possible leakage during error flow
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
-rw-r--r-- | drivers/nvme/host/tcp.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 820dac10fa9e..770dbcbc999e 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -2136,6 +2136,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; |