Coverity fixes (VPP-1204)
Minor bug fixes
CID 183000: double close
CID 180996: dead code
CID 180995: NULL deref
CID 181957: NULL deref
CID 182676: NULL deref
CID 182675: NULL deref
Change-Id: Id35e391c95fafb8cd771984ee8a1a6e597056d37
Signed-off-by: Chris Luke <chrisy@flirble.org>
diff --git a/src/vnet/srmpls/sr_mpls_steering.c b/src/vnet/srmpls/sr_mpls_steering.c
index 8bb072c..c5ddab7 100755
--- a/src/vnet/srmpls/sr_mpls_steering.c
+++ b/src/vnet/srmpls/sr_mpls_steering.c
@@ -393,22 +393,16 @@
memset (&key, 0, sizeof (sr_mpls_steering_key_t));
- /* Compute the steer policy key */
- if (traffic_type == SR_STEER_IPV4 || traffic_type == SR_STEER_IPV6)
- {
- key.prefix.as_u64[0] = prefix->as_u64[0];
- key.prefix.as_u64[1] = prefix->as_u64[1];
- key.mask_width = mask_width;
- key.fib_table = (table_id != (u32) ~ 0 ? table_id : 0);
- }
- else
- return -1;
-
- key.traffic_type = traffic_type;
-
if (traffic_type != SR_STEER_IPV4 && traffic_type != SR_STEER_IPV6)
return -1;
+ /* Compute the steer policy key */
+ key.prefix.as_u64[0] = prefix->as_u64[0];
+ key.prefix.as_u64[1] = prefix->as_u64[1];
+ key.mask_width = mask_width;
+ key.fib_table = (table_id != (u32) ~ 0 ? table_id : 0);
+ key.traffic_type = traffic_type;
+
/*
* Search for steering policy. If already exists we are adding a new
* color.