summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Zhongjin <chenzhongjin@huawei.com>2022-11-15 12:24:42 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 13:30:23 +0300
commitcf74d1197c0e3d2f353faa333e9e2847c73713f1 (patch)
tree5ad6f4b395f4576811c89caa3eec71fd6cc4a033
parent5debd337f534b122f7c5eac6557a41b5636c9b51 (diff)
downloadlinux-cf74d1197c0e3d2f353faa333e9e2847c73713f1.tar.xz
scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails
[ Upstream commit 4155658cee394b22b24c6d64e49247bf26d95b92 ] fcoe_init() calls fcoe_transport_attach(&fcoe_sw_transport), but when fcoe_if_init() fails, &fcoe_sw_transport is not detached and leaves freed &fcoe_sw_transport on fcoe_transports list. This causes panic when reinserting module. BUG: unable to handle page fault for address: fffffbfff82e2213 RIP: 0010:fcoe_transport_attach+0xe1/0x230 [libfcoe] Call Trace: <TASK> do_one_initcall+0xd0/0x4e0 load_module+0x5eee/0x7210 ... Fixes: 78a582463c1e ("[SCSI] fcoe: convert fcoe.ko to become an fcoe transport provider driver") Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com> Link: https://lore.kernel.org/r/20221115092442.133088-1-chenzhongjin@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/scsi/fcoe/fcoe.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 6768b2e8148a..c5c4805435f6 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -2519,6 +2519,7 @@ static int __init fcoe_init(void)
out_free:
mutex_unlock(&fcoe_config_mutex);
+ fcoe_transport_detach(&fcoe_sw_transport);
out_destroy:
destroy_workqueue(fcoe_wq);
return rc;