From 81fceaec6eea05efb942a188c3d92dd73a1a8aa0 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 16 Nov 2016 23:00:57 +0000 Subject: [PATCH] [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 --- src/net/tcp/iscsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/net/tcp/iscsi.c b/src/net/tcp/iscsi.c index ec004e4b..d6f80084 100644 --- a/src/net/tcp/iscsi.c +++ b/src/net/tcp/iscsi.c @@ -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 );