nvme-tcp: fix a NULL deref when an admin connect times out
authorSagi Grimberg <sagi@grimberg.me>
Wed, 24 Apr 2019 18:53:17 +0000 (11:53 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:44:59 +0000 (06:44 -0700)
commit47f986bac28d011e3aec960f28583f4d99fc6d5c
tree98fbfcf17e7ad828ff901b41757356d569b16a26
parente9dd0fd8233f8eb2e4513283cf9c78beaa87e113
nvme-tcp: fix a NULL deref when an admin connect times out

[ Upstream commit 7a42589654ae79e1177f0d74306a02d6cef7bddf ]

If we timeout the admin startup sequence we might not yet have
an I/O tagset allocated which causes the teardown sequence to crash.
Make nvme_tcp_teardown_io_queues safe by not iterating inflight tags
if the tagset wasn't allocated.

Fixes: 39d57757467b ("nvme-tcp: fix timeout handler")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/tcp.c