nvmet-tcp: fix a segmentation fault during io parsing error
authorElad Grupi <elad.grupi@dell.com>
Wed, 31 Mar 2021 09:13:14 +0000 (17:13 +0800)
committerChristoph Hellwig <hch@lst.de>
Thu, 15 Apr 2021 06:12:50 +0000 (08:12 +0200)
commitbdaf13279192c60b2b1fc99badef53b494fec055
tree0ec1e9a2a42c85dac6177d6b724028629421a524
parentf8ee34a929a4adf6d29a7ef2145393e6865037ad
nvmet-tcp: fix a segmentation fault during io parsing error

In case there is an io that contains inline data and it goes to
parsing error flow, command response will free command and iov
before clearing the data on the socket buffer.
This will delay the command response until receive flow is completed.

Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver")
Signed-off-by: Elad Grupi <elad.grupi@dell.com>
Signed-off-by: Hou Pu <houpu.main@gmail.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/tcp.c