Blame SOURCES/0025-log-failures-typically-malloc-of-iscsi_create_context-during-reconnect.patch

dc245c
log failures (typically malloc) of iscsi_create_context during reconnect
dc245c
dc245c
Message-id: <1383729402-27559-7-git-send-email-pbonzini@redhat.com>
dc245c
Patchwork-id: 55501
dc245c
O-Subject: [PATCH 06/11] log failures (typically malloc) of iscsi_create_context during reconnect
dc245c
Bugzilla: 1026820
dc245c
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
dc245c
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
dc245c
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
dc245c
dc245c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
dc245c
(cherry picked from commit 1acce4a94892ffc8fb75945fc2d2ee691b66a524)
dc245c
---
dc245c
 lib/connect.c | 5 +++++
dc245c
 1 file changed, 5 insertions(+)
dc245c
diff --git a/lib/connect.c b/lib/connect.c
dc245c
index d6a8759..cd3f336 100644
dc245c
--- a/lib/connect.c
dc245c
+++ b/lib/connect.c
dc245c
@@ -245,6 +245,11 @@ int iscsi_reconnect(struct iscsi_context *old_iscsi)
dc245c
 try_again:
dc245c
 
dc245c
 	iscsi = iscsi_create_context(old_iscsi->initiator_name);
dc245c
+	if (!iscsi) {
dc245c
+		ISCSI_LOG(old_iscsi, 2, "failed to create new context for reconnection");
dc245c
+		return -1;
dc245c
+	}
dc245c
+
dc245c
 	iscsi->is_reconnecting = 1;
dc245c
 
dc245c
 	iscsi_set_targetname(iscsi, old_iscsi->target_name);