team: rtnl_lock for options set
authorJiri Pirko <jiri@mellanox.com>
Thu, 3 Dec 2015 11:12:17 +0000 (12:12 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Dec 2015 16:49:26 +0000 (11:49 -0500)
During options set, there will be needed to hold rtnl_mutex in order to
safely call netdev notifiers.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/team/team.c

index dd1504bbb4a75429059d29647527458bb25a8823..98141338d0ce3931d194bb88173c10b658fdd734 100644 (file)
@@ -2422,9 +2422,13 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)
        struct nlattr *nl_option;
        LIST_HEAD(opt_inst_list);
 
+       rtnl_lock();
+
        team = team_nl_team_get(info);
-       if (!team)
-               return -EINVAL;
+       if (!team) {
+               err = -EINVAL;
+               goto rtnl_unlock;
+       }
 
        err = -EINVAL;
        if (!info->attrs[TEAM_ATTR_LIST_OPTION]) {
@@ -2551,7 +2555,8 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)
 
 team_put:
        team_nl_team_put(team);
-
+rtnl_unlock:
+       rtnl_unlock();
        return err;
 }