Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277565
b: refs/heads/master
c: 8c0713a
h: refs/heads/master
i:
  277563: f85561d
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Nov 16, 2011
1 parent 04a7064 commit 8c74bb5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d445ba613fe445c8f30733e68089614b40b3df5b
refs/heads/master: 8c0713a57482ebfadef197c856a38af3a55444c6
11 changes: 5 additions & 6 deletions trunk/drivers/net/team/team.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,8 +1043,7 @@ static int team_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info)

/*
* Netlink cmd functions should be locked by following two functions.
* To ensure team_uninit would not be called in between, hold rcu_read_lock
* all the time.
* Since dev gets held here, that ensures dev won't disappear in between.
*/
static struct team *team_nl_team_get(struct genl_info *info)
{
Expand All @@ -1057,10 +1056,10 @@ static struct team *team_nl_team_get(struct genl_info *info)
return NULL;

ifindex = nla_get_u32(info->attrs[TEAM_ATTR_TEAM_IFINDEX]);
rcu_read_lock();
dev = dev_get_by_index_rcu(net, ifindex);
dev = dev_get_by_index(net, ifindex);
if (!dev || dev->netdev_ops != &team_netdev_ops) {
rcu_read_unlock();
if (dev)
dev_put(dev);
return NULL;
}

Expand All @@ -1072,7 +1071,7 @@ static struct team *team_nl_team_get(struct genl_info *info)
static void team_nl_team_put(struct team *team)
{
spin_unlock(&team->lock);
rcu_read_unlock();
dev_put(team->dev);
}

static int team_nl_send_generic(struct genl_info *info, struct team *team,
Expand Down

0 comments on commit 8c74bb5

Please sign in to comment.