Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314823
b: refs/heads/master
c: 878d9ec
h: refs/heads/master
i:
  314821: dd26b01
  314819: e4b8f4b
  314815: 4b696df
v: v3
  • Loading branch information
Johannes Berg committed Jun 20, 2012
1 parent 7bc2c87 commit a3a2dc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 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: 4f7eff10b20fc86f71f2db83e6b16cb5fbde8dbc
refs/heads/master: 878d9ec7367816dc336b0c24e6256596559692b7
19 changes: 10 additions & 9 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,23 @@ static int get_rdev_dev_by_ifindex(struct net *netns, struct nlattr **attrs,
}

static struct cfg80211_registered_device *
__cfg80211_rdev_from_info(struct net *netns, struct genl_info *info)
__cfg80211_rdev_from_attrs(struct net *netns, struct nlattr **attrs)
{
struct cfg80211_registered_device *rdev = NULL, *tmp;
struct net_device *netdev;

assert_cfg80211_lock();

if (!info->attrs[NL80211_ATTR_WIPHY] &&
!info->attrs[NL80211_ATTR_IFINDEX])
if (!attrs[NL80211_ATTR_WIPHY] &&
!attrs[NL80211_ATTR_IFINDEX])
return ERR_PTR(-EINVAL);

if (info->attrs[NL80211_ATTR_WIPHY])
if (attrs[NL80211_ATTR_WIPHY])
rdev = cfg80211_rdev_by_wiphy_idx(
nla_get_u32(info->attrs[NL80211_ATTR_WIPHY]));
nla_get_u32(attrs[NL80211_ATTR_WIPHY]));

if (info->attrs[NL80211_ATTR_IFINDEX]) {
int ifindex = nla_get_u32(info->attrs[NL80211_ATTR_IFINDEX]);
if (attrs[NL80211_ATTR_IFINDEX]) {
int ifindex = nla_get_u32(attrs[NL80211_ATTR_IFINDEX]);
netdev = dev_get_by_index(netns, ifindex);
if (netdev) {
if (netdev->ieee80211_ptr)
Expand Down Expand Up @@ -145,7 +145,7 @@ cfg80211_get_dev_from_info(struct net *netns, struct genl_info *info)
struct cfg80211_registered_device *rdev;

mutex_lock(&cfg80211_mutex);
rdev = __cfg80211_rdev_from_info(netns, info);
rdev = __cfg80211_rdev_from_attrs(netns, info->attrs);

/* if it is not an error we grab the lock on
* it to assure it won't be going away while
Expand Down Expand Up @@ -1422,7 +1422,8 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
}

if (!netdev) {
rdev = __cfg80211_rdev_from_info(genl_info_net(info), info);
rdev = __cfg80211_rdev_from_attrs(genl_info_net(info),
info->attrs);
if (IS_ERR(rdev)) {
mutex_unlock(&cfg80211_mutex);
return PTR_ERR(rdev);
Expand Down

0 comments on commit a3a2dc9

Please sign in to comment.