From: Jiri Pirko Date: Thu, 3 Dec 2015 11:12:17 +0000 (+0100) Subject: team: rtnl_lock for options set X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7d259505299cb6f4642eac4eebb191d6c2ebe558;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: David S. Miller --- 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; }