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

Roland Kammerer roland.kammerer at linbit.com
Wed Jan 30 18:15:34 CET 2019


On Wed, Jan 30, 2019 at 04:48:16PM +0100, Johannes Thoma wrote:
> 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;
>  

Good catch, it's this one fine continue... Applied.

Thanks, rck


More information about the drbd-dev mailing list