aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAndrey "Zed" Zaikin <zed.0xff@gmail.com>2018-05-25 18:09:58 +0300
committerDamjan Marion <dmarion.lists@gmail.com>2018-05-28 15:02:30 +0000
commitff5aad76be69a0b50821bc70c25882c84b5c7785 (patch)
tree331d83fb2efedf56b09751c8976bc1a37917e68e /src/plugins
parent0318a113fd7848c76533027edbdee2697442a76e (diff)
add missing lb_put_writer_lock() to lb_vip_add() invalid args cases
Change-Id: I9343672c5765a5a4cb56c99fa5de176ddcac62c7 Signed-off-by: Andrey "Zed" Zaikin <zed.0xff@gmail.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lb/lb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/lb/lb.c b/src/plugins/lb/lb.c
index e1d4df55a3e..d5dc3054fb4 100644
--- a/src/plugins/lb/lb.c
+++ b/src/plugins/lb/lb.c
@@ -845,17 +845,22 @@ int lb_vip_add(lb_vip_add_args_t args, u32 *vip_index)
(type != LB_VIP_TYPE_IP4_GRE4) &&
(type != LB_VIP_TYPE_IP4_GRE6) &&
(type != LB_VIP_TYPE_IP4_L3DSR) &&
- (type != LB_VIP_TYPE_IP4_NAT4))
+ (type != LB_VIP_TYPE_IP4_NAT4)) {
+ lb_put_writer_lock();
return VNET_API_ERROR_INVALID_ADDRESS_FAMILY;
+ }
if ((!ip46_prefix_is_ip4(&(args.prefix), args.plen)) &&
(type != LB_VIP_TYPE_IP6_GRE4) &&
(type != LB_VIP_TYPE_IP6_GRE6) &&
- (type != LB_VIP_TYPE_IP6_NAT6))
+ (type != LB_VIP_TYPE_IP6_NAT6)) {
+ lb_put_writer_lock();
return VNET_API_ERROR_INVALID_ADDRESS_FAMILY;
+ }
if ((type == LB_VIP_TYPE_IP4_L3DSR) && (args.encap_args.dscp >= 64 ) )
{
+ lb_put_writer_lock();
return VNET_API_ERROR_VALUE_EXIST;
}