Skip to content

Commit

Permalink
[iscsi] Avoid potential infinite loops during shutdown
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mcb30 committed Nov 16, 2016
1 parent daa8ed9 commit 81fceae
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/net/tcp/iscsi.c
Expand Up @@ -231,6 +231,7 @@ static void iscsi_close ( struct iscsi_session *iscsi, int rc ) {
process_del ( &iscsi->process );

/* Shut down interfaces */
intf_nullify ( &iscsi->data ); /* avoid potential loops */
intf_shutdown ( &iscsi->socket, rc );
intf_shutdown ( &iscsi->control, rc );
intf_shutdown ( &iscsi->data, rc );
Expand Down

0 comments on commit 81fceae

Please sign in to comment.