Skip to content

Commit

Permalink
datapath: don't unlock mutex when changing the user_features fails
Browse files Browse the repository at this point in the history
Upstream commit:
    commit 4c76bf696a608ea5cc555fe97ec59a9033236604
    Author: Tonghao Zhang <[email protected]>
    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 <[email protected]>
    Signed-off-by: Tonghao Zhang <[email protected]>
    Tested-by: Greg Rose <[email protected]>
    Acked-by: William Tu <[email protected]>
    Acked-by: Pravin B Shelar <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

Reviewed-by: Tonghao Zhang <[email protected]>
Acked-by: Yi-Hung Wei <[email protected]>
Signed-off-by: Greg Rose <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
xpu22 authored and igsilya committed Oct 17, 2020
1 parent b7465ca commit c07157c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datapath/datapath.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
Expand Down

0 comments on commit c07157c

Please sign in to comment.