]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'wireless-next/master'
authorStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 03:10:15 +0000 (13:10 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 03:10:15 +0000 (13:10 +1000)
Conflicts:
net/wireless/nl80211.c

1  2 
drivers/net/wireless/ath/ath9k/htc_drv_debug.c
net/bluetooth/hidp/core.c
net/wireless/core.c
net/wireless/nl80211.c

Simple merge
Simple merge
index e545023e2871a3d6ee3c7efdfba9abc7571f2427,7dc3343427c198b89342e5014af4412a5f24d2b7..1cc47aca7f05baee3e7ffdf18a4e002b2d62279d
@@@ -1520,47 -1562,23 +1562,25 @@@ static int nl80211_dump_wiphy_parse(str
  static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
  {
        int idx = 0, ret;
-       int start = cb->args[0];
+       struct nl80211_dump_wiphy_state *state = (void *)cb->args[0];
        struct cfg80211_registered_device *dev;
-       s64 filter_wiphy = -1;
-       bool split = false;
-       struct nlattr **tb;
-       int res;
-       /* will be zeroed in nlmsg_parse() */
-       tb = kmalloc(sizeof(*tb) * (NL80211_ATTR_MAX + 1), GFP_KERNEL);
-       if (!tb)
-               return -ENOMEM;
  
        rtnl_lock();
-       res = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize,
-                         tb, NL80211_ATTR_MAX, nl80211_policy);
-       if (res == 0) {
-               split = tb[NL80211_ATTR_SPLIT_WIPHY_DUMP];
-               if (tb[NL80211_ATTR_WIPHY])
-                       filter_wiphy = nla_get_u32(tb[NL80211_ATTR_WIPHY]);
-               if (tb[NL80211_ATTR_WDEV])
-                       filter_wiphy = nla_get_u64(tb[NL80211_ATTR_WDEV]) >> 32;
-               if (tb[NL80211_ATTR_IFINDEX]) {
-                       struct net_device *netdev;
-                       int ifidx = nla_get_u32(tb[NL80211_ATTR_IFINDEX]);
-                       netdev = dev_get_by_index(sock_net(skb->sk), ifidx);
-                       if (!netdev) {
-                               rtnl_unlock();
-                               kfree(tb);
-                               return -ENODEV;
-                       }
-                       if (netdev->ieee80211_ptr) {
-                               dev = wiphy_to_dev(
-                                       netdev->ieee80211_ptr->wiphy);
-                               filter_wiphy = dev->wiphy_idx;
-                       }
-                       dev_put(netdev);
+       if (!state) {
+               state = kzalloc(sizeof(*state), GFP_KERNEL);
 -              if (!state)
++              if (!state) {
++                      rtnl_unlock();
+                       return -ENOMEM;
 +              }
+               state->filter_wiphy = -1;
+               ret = nl80211_dump_wiphy_parse(skb, cb, state);
+               if (ret) {
+                       kfree(state);
+                       rtnl_unlock();
+                       return ret;
+               }
+               cb->args[0] = (long)state;
        }
-       kfree(tb);
  
        list_for_each_entry(dev, &cfg80211_rdev_list, list) {
                if (!net_eq(wiphy_net(&dev->wiphy), sock_net(skb->sk)))