]> git.proxmox.com Git - ovs.git/commitdiff
datapath: don't unlock mutex when changing the user_features fails
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Mon, 12 Oct 2020 20:24:54 +0000 (13:24 -0700)
committerIlya Maximets <i.maximets@ovn.org>
Sat, 17 Oct 2020 15:32:06 +0000 (17:32 +0200)
Upstream commit:
    commit 4c76bf696a608ea5cc555fe97ec59a9033236604
    Author: Tonghao Zhang <xiangxia.m.yue@gmail.com>
    Date:   Fri Nov 1 22:23:53 2019 +0800

    net: openvswitch: don't unlock mutex when changing the user_features fails

    Unlocking of a not locked mutex is not allowed.
    Other kernel thread may be in critical section while
    we unlock it because of setting user_feature fail.

Fixes: 95a7233c4 ("net: openvswitch: Set OvS recirc_id from tc chain index")
Cc: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: William Tu <u9012063@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
datapath/datapath.c

index aceb655bdd80d2500c5a1a5d98f4920faa93c17e..cf216c8ec7a053e086f35f8b7aa6b14e686b14ba 100644 (file)
@@ -1746,6 +1746,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
                                ovs_dp_reset_user_features(skb, info);
                }
 
+               ovs_unlock();
                goto err_destroy_meters;
        }
 
@@ -1762,7 +1763,6 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
        return 0;
 
 err_destroy_meters:
-       ovs_unlock();
        ovs_meters_exit(dp);
 err_destroy_ports_array:
        kfree(dp->ports);