sr: fix coverity warning
[vpp.git] / src / vnet / srv6 / sr_steering.c
index 9db1390..6e5c5e0 100644 (file)
@@ -184,9 +184,6 @@ sr_steering_policy (int is_del, ip6_address_t * bsid, u32 sr_policy_index,
          else
            sr_policy = pool_elt_at_index (sm->sr_policies, sr_policy_index);
 
-         if (!sr_policy)
-           return -2;
-
          steer_pl->sr_policy = sr_policy - sm->sr_policies;
 
          /* Remove old FIB/hw redirection and create a new one */
@@ -411,7 +408,7 @@ sr_steer_policy_command_fn (vlib_main_t * vm, unformat_input_t * input,
 
   if (!traffic_type)
     return clib_error_return (0, "No L2/L3 traffic specified");
-  if (!sr_policy_set)
+  if (!is_del && !sr_policy_set)
     return clib_error_return (0, "No SR policy specified");
 
   /* Make sure that the prefixes are clean */