Commit 096a85c5 authored by Mike Hibler's avatar Mike Hibler
Browse files

Nit: add some missing unlock calls on errors.

parent 75b39948
...@@ -8003,8 +8003,10 @@ sub CheckIPAddressReservations($) { ...@@ -8003,8 +8003,10 @@ sub CheckIPAddressReservations($) {
# Now preload the reservations in the DB, including those associated # Now preload the reservations in the DB, including those associated
# with this experiment. The buddy allocator will allocate around # with this experiment. The buddy allocator will allocate around
# these. # these.
$buddy->loadReservedRanges($self->experiment()) == 0 if ($buddy->loadReservedRanges($self->experiment())) {
or return -1; $buddy->unlock();
return -1;
}
foreach my $virtlan (@sharedlans) { foreach my $virtlan (@sharedlans) {
my $vlanname = $virtlan->vname(); my $vlanname = $virtlan->vname();
...@@ -8018,9 +8020,11 @@ sub CheckIPAddressReservations($) { ...@@ -8018,9 +8020,11 @@ sub CheckIPAddressReservations($) {
} }
if ($hbits > 24) { if ($hbits > 24) {
tberror("Lan $vlanname has too many members!\n"); tberror("Lan $vlanname has too many members!\n");
$buddy->unlock();
return -1; return -1;
} }
my $prefix = 32 - $hbits; my $prefix = 32 - $hbits;
$self->printdb("Got prefix $prefix\n");
my $newmask = Socket::inet_ntoa(pack("B32", "1" x $prefix)); my $newmask = Socket::inet_ntoa(pack("B32", "1" x $prefix));
$virtlan->_mask($newmask); $virtlan->_mask($newmask);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment