Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Sep 2009 16:22:20 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r196883 - head/sys/netipsec
Message-ID:  <20090906162102.Q68375@maildrop.int.zabbadoz.net>
In-Reply-To: <200909060732.n867WGwc076608@svn.freebsd.org>
References:  <200909060732.n867WGwc076608@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 6 Sep 2009, Pawel Jakub Dawidek wrote:

> Author: pjd
> Date: Sun Sep  6 07:32:16 2009
> New Revision: 196883
> URL: http://svn.freebsd.org/changeset/base/196883
>
> Log:
>  Improve code a bit by eliminating goto and having one unlock per lock.

This does not coompile anymore:

HEAD.svn/sys/netipsec/key.c: In function 'key_checkrequest':
HEAD.svn/sys/netipsec/key.c: warning: 'state_valid' may be used uninitialized in this function
HEAD.svn/sys/netipsec/key.c: note: 'state_valid' was declared here






> Modified:
>  head/sys/netipsec/key.c
>
> Modified: head/sys/netipsec/key.c
> ==============================================================================
> --- head/sys/netipsec/key.c	Sun Sep  6 07:30:21 2009	(r196882)
> +++ head/sys/netipsec/key.c	Sun Sep  6 07:32:16 2009	(r196883)
> @@ -918,15 +918,14 @@ key_allocsa_policy(const struct secasind
> 				state_valid = saorder_state_valid_prefer_new;
> 				arraysize = N(saorder_state_valid_prefer_new);
> 			}
> -			SAHTREE_UNLOCK();
> -			goto found;
> +			break;
> 		}
> 	}
> 	SAHTREE_UNLOCK();
>
> -	return NULL;
> +	if (sah == NULL)
> +		return NULL;
>
> -    found:
> 	/* search valid state */
> 	for (stateidx = 0; stateidx < arraysize; stateidx++) {
> 		sav = key_do_allocsa_policy(sah, state_valid[stateidx]);
>

-- 
Bjoern A. Zeeb           What was I talking about and who are you again?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090906162102.Q68375>