[Drbd-dev] [PATCH] Fix an uninitialized use of loop condition.

Johannes Thoma johannes at johannesthoma.com
Wed Jan 30 16:48:16 CET 2019


On a continue the loop condition is checked, however the
condition used a yet uninitialied variable. gcc does not
warn about this, however other compilers (Microsoft Visual C,
IBM AS/400 C compiler) do.
---
 drbd/drbd_transport_tcp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drbd/drbd_transport_tcp.c b/drbd/drbd_transport_tcp.c
index 64515dce..0eb45567 100644
--- a/drbd/drbd_transport_tcp.c
+++ b/drbd/drbd_transport_tcp.c
@@ -941,6 +941,7 @@ static int dtt_connect(struct drbd_transport *transport)
 	connect_to_path = container_of(drbd_path, struct dtt_path, path);
 	spin_unlock(&tcp_transport->paths_lock);
 
+	ok = false;
 	do {
 		struct socket *s = NULL;
 
-- 
2.17.0



More information about the drbd-dev mailing list