summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2015-12-03 14:12:17 +0300
committerDavid S. Miller <davem@davemloft.net>2015-12-03 19:49:26 +0300
commit7d259505299cb6f4642eac4eebb191d6c2ebe558 (patch)
tree7c0e3dfd9643fc6a7020b94c639a9fb12bd99a80 /drivers/net
parentfb1b2e3ce53aef80b3cef71f3885d584cdbdc6b8 (diff)
downloadlinux-7d259505299cb6f4642eac4eebb191d6c2ebe558.tar.xz
team: rtnl_lock for options set
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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/team/team.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index dd1504bbb4a7..98141338d0ce 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -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;
}