nvme-fc: fix initialization order
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Fri, 20 Jan 2023 17:43:54 +0000 (17:43 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:34:43 +0000 (08:34 +0100)
commit048c82c0b3bd1372f4020d29414b848b17d01839
tree783c6bee4832b7eb217787cb46f0df43b9db8bfe
parent74673597c100d63983003c5c1c01ec17e3e91094
nvme-fc: fix initialization order

[ Upstream commit 98e3528012cd571c48bbae7c7c0f868823254b6c ]

ctrl->ops is used by nvme_alloc_admin_tag_set() but set by
nvme_init_ctrl() so reorder the calls to avoid a NULL pointer
dereference.

Fixes: 6dfba1c09c10 ("nvme-fc: use the tagset alloc/free helpers")
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-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/fc.c