Improve code a bit by eliminating goto and having one unlock per lock.

This commit is contained in:
Pawel Jakub Dawidek 2009-09-06 07:32:16 +00:00
parent cee0fa809b
commit 950ab2f81e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=196883

View File

@ -918,15 +918,14 @@ key_allocsa_policy(const struct secasindex *saidx)
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]);