瀏覽代碼

[iscsi] Avoid potential infinite loops during shutdown

The command and data interfaces may be connected to the same object.
Nullify the data interface before shutting down the control interface
to avoid potential infinite loops.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 7 年之前
父節點
當前提交
81fceaec6e
共有 1 個檔案被更改,包括 1 行新增0 行删除
  1. 1
    0
      src/net/tcp/iscsi.c

+ 1
- 0
src/net/tcp/iscsi.c 查看文件

@@ -231,6 +231,7 @@ static void iscsi_close ( struct iscsi_session *iscsi, int rc ) {
231 231
 	process_del ( &iscsi->process );
232 232
 
233 233
 	/* Shut down interfaces */
234
+	intf_nullify ( &iscsi->data ); /* avoid potential loops */
234 235
 	intf_shutdown ( &iscsi->socket, rc );
235 236
 	intf_shutdown ( &iscsi->control, rc );
236 237
 	intf_shutdown ( &iscsi->data, rc );

Loading…
取消
儲存