Skip to content

Commit

Permalink
Merge tag 'mac80211-for-davem-2015-02-27' of git://git.kernel.org/pub…
Browse files Browse the repository at this point in the history
…/scm/linux/kernel/git/jberg/mac80211

Johannes Berg says:

====================
A few patches have accumulated, among them the fix for Linus's
four-way-handshake problem. The others are various small fixes
for problems all over, nothing really stands out.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 1, 2015
2 parents 06615be + 9c1c98a commit 32034e0
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 10 deletions.
5 changes: 4 additions & 1 deletion drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,8 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
goto nla_put_failure;

genlmsg_end(skb, msg_head);
genlmsg_unicast(&init_net, skb, dst_portid);
if (genlmsg_unicast(&init_net, skb, dst_portid))
goto err_free_txskb;

/* Enqueue the packet */
skb_queue_tail(&data->pending, my_skb);
Expand All @@ -955,6 +956,8 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
return;

nla_put_failure:
nlmsg_free(skb);
err_free_txskb:
printk(KERN_DEBUG "mac80211_hwsim: error occurred in %s\n", __func__);
ieee80211_free_txskb(hw, my_skb);
data->tx_failed++;
Expand Down
5 changes: 5 additions & 0 deletions net/mac80211/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,8 @@ static void __ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata)
if (ieee80211_chanctx_refcount(local, ctx) == 0)
ieee80211_free_chanctx(local, ctx);

sdata->radar_required = false;

/* Unreserving may ready an in-place reservation. */
if (use_reserved_switch)
ieee80211_vif_use_reserved_switch(local);
Expand Down Expand Up @@ -1566,6 +1568,9 @@ int ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,
ieee80211_recalc_smps_chanctx(local, ctx);
ieee80211_recalc_radar_chanctx(local, ctx);
out:
if (ret)
sdata->radar_required = false;

mutex_unlock(&local->chanctx_mtx);
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion net/mac80211/rc80211_minstrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
rate++;
mi->sample_deferred++;
} else {
if (!msr->sample_limit != 0)
if (!msr->sample_limit)
return;

mi->sample_packets++;
Expand Down
1 change: 1 addition & 0 deletions net/mac80211/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ ieee80211_tx_h_check_control_port_protocol(struct ieee80211_tx_data *tx)
if (tx->sdata->control_port_no_encrypt)
info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
info->control.flags |= IEEE80211_TX_CTRL_PORT_CTRL_PROTO;
info->flags |= IEEE80211_TX_CTL_USE_MINRATE;
}

return TX_CONTINUE;
Expand Down
1 change: 1 addition & 0 deletions net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,7 @@ static int __init cfg80211_init(void)
regulatory_exit();
out_fail_reg:
debugfs_remove(ieee80211_debugfs_dir);
nl80211_exit();
out_fail_nl80211:
unregister_netdevice_notifier(&cfg80211_netdev_notifier);
out_fail_notifier:
Expand Down
12 changes: 5 additions & 7 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -2654,10 +2654,6 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
return err;
}

msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg)
return -ENOMEM;

err = parse_monitor_flags(type == NL80211_IFTYPE_MONITOR ?
info->attrs[NL80211_ATTR_MNTR_FLAGS] : NULL,
&flags);
Expand All @@ -2666,6 +2662,10 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
!(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR))
return -EOPNOTSUPP;

msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg)
return -ENOMEM;

wdev = rdev_add_virtual_intf(rdev,
nla_data(info->attrs[NL80211_ATTR_IFNAME]),
type, err ? NULL : &flags, &params);
Expand Down Expand Up @@ -12528,9 +12528,7 @@ static int cfg80211_net_detect_results(struct sk_buff *msg,
}

for (j = 0; j < match->n_channels; j++) {
if (nla_put_u32(msg,
NL80211_ATTR_WIPHY_FREQ,
match->channels[j])) {
if (nla_put_u32(msg, j, match->channels[j])) {
nla_nest_cancel(msg, nl_freqs);
nla_nest_cancel(msg, nl_match);
goto out;
Expand Down
2 changes: 1 addition & 1 deletion net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static DECLARE_DELAYED_WORK(reg_timeout, reg_timeout_work);

/* We keep a static world regulatory domain in case of the absence of CRDA */
static const struct ieee80211_regdomain world_regdom = {
.n_reg_rules = 6,
.n_reg_rules = 8,
.alpha2 = "00",
.reg_rules = {
/* IEEE 802.11b/g, channels 1..11 */
Expand Down

0 comments on commit 32034e0

Please sign in to comment.