]> git.proxmox.com Git - ovs.git/commitdiff
netdev-tc-offloads: Don't delete ufid mapping if fail to delete filter
authorJianbo Liu <jianbol@nvidia.com>
Wed, 14 Oct 2020 10:31:04 +0000 (13:31 +0300)
committerSimon Horman <simon.horman@netronome.com>
Fri, 23 Oct 2020 14:20:46 +0000 (16:20 +0200)
tc_replace_flower may fail, so the return value must be checked.
If not zero, ufid can't be deleted. Otherwise the operations on this
filter may fail because its ufid is not found.

Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
lib/netdev-offload-tc.c

index 18ff380f9861d04ff89a527be345fd5e8411f3c1..e828a8683910ab00a093b29ba25846a4cca90429 100644 (file)
@@ -198,7 +198,9 @@ del_filter_and_ufid_mapping(struct tcf_id *id, const ovs_u128 *ufid)
     int err;
 
     err = tc_del_filter(id);
-    del_ufid_tc_mapping(ufid);
+    if (!err) {
+        del_ufid_tc_mapping(ufid);
+    }
     return err;
 }