linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails
@ 2022-11-15  9:24 Chen Zhongjin
  2022-11-26  0:21 ` Martin K. Petersen
  2022-12-01  3:45 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Chen Zhongjin @ 2022-11-15  9:24 UTC (permalink / raw)
  To: linux-kernel, linux-scsi
  Cc: chenzhongjin, hare, jejb, martin.petersen, robert.w.love, yi.zou,
	James.Bottomley, bprakash

fcoe_init() calls fcoe_transport_attach(&fcoe_sw_transport), but when
fcoe_if_init() fails, &fcoe_sw_transport is not detached and leave freed
&fcoe_sw_transport on list fcoe_transports, which 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>
---
 drivers/scsi/fcoe/fcoe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 6ec296321ffc..38774a272e62 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -2491,6 +2491,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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails
  2022-11-15  9:24 [PATCH] scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails Chen Zhongjin
@ 2022-11-26  0:21 ` Martin K. Petersen
  2022-12-01  3:45 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-11-26  0:21 UTC (permalink / raw)
  To: Chen Zhongjin
  Cc: linux-kernel, linux-scsi, hare, jejb, martin.petersen,
	robert.w.love, yi.zou, James.Bottomley, bprakash


Chen,

> fcoe_init() calls fcoe_transport_attach(&fcoe_sw_transport), but when
> fcoe_if_init() fails, &fcoe_sw_transport is not detached and leave freed
> &fcoe_sw_transport on list fcoe_transports, which causes panic when
> reinserting module.

Applied to 6.2/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails
  2022-11-15  9:24 [PATCH] scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails Chen Zhongjin
  2022-11-26  0:21 ` Martin K. Petersen
@ 2022-12-01  3:45 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-12-01  3:45 UTC (permalink / raw)
  To: linux-kernel, linux-scsi, Chen Zhongjin
  Cc: Martin K . Petersen, jejb, bprakash, robert.w.love,
	James.Bottomley, hare, yi.zou

On Tue, 15 Nov 2022 17:24:42 +0800, Chen Zhongjin wrote:

> fcoe_init() calls fcoe_transport_attach(&fcoe_sw_transport), but when
> fcoe_if_init() fails, &fcoe_sw_transport is not detached and leave freed
> &fcoe_sw_transport on list fcoe_transports, which 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
>   ...
> 
> [...]

Applied to 6.2/scsi-queue, thanks!

[1/1] scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails
      https://git.kernel.org/mkp/scsi/c/4155658cee39

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-01  3:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15  9:24 [PATCH] scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails Chen Zhongjin
2022-11-26  0:21 ` Martin K. Petersen
2022-12-01  3:45 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).