Commit 48c3e371 authored by John W. Linville's avatar John W. Linville
parents 909bd592 dee8a973
...@@ -2622,8 +2622,8 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) ...@@ -2622,8 +2622,8 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
NL80211_CMD_NEW_KEY); NL80211_CMD_NEW_KEY);
if (IS_ERR(hdr)) if (!hdr)
return PTR_ERR(hdr); return -ENOBUFS;
cookie.msg = msg; cookie.msg = msg;
cookie.idx = key_idx; cookie.idx = key_idx;
...@@ -6507,6 +6507,9 @@ static int nl80211_testmode_dump(struct sk_buff *skb, ...@@ -6507,6 +6507,9 @@ static int nl80211_testmode_dump(struct sk_buff *skb,
NL80211_CMD_TESTMODE); NL80211_CMD_TESTMODE);
struct nlattr *tmdata; struct nlattr *tmdata;
if (!hdr)
break;
if (nla_put_u32(skb, NL80211_ATTR_WIPHY, phy_idx)) { if (nla_put_u32(skb, NL80211_ATTR_WIPHY, phy_idx)) {
genlmsg_cancel(skb, hdr); genlmsg_cancel(skb, hdr);
break; break;
...@@ -6951,9 +6954,8 @@ static int nl80211_remain_on_channel(struct sk_buff *skb, ...@@ -6951,9 +6954,8 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
NL80211_CMD_REMAIN_ON_CHANNEL); NL80211_CMD_REMAIN_ON_CHANNEL);
if (!hdr) {
if (IS_ERR(hdr)) { err = -ENOBUFS;
err = PTR_ERR(hdr);
goto free_msg; goto free_msg;
} }
...@@ -7251,9 +7253,8 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info) ...@@ -7251,9 +7253,8 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
NL80211_CMD_FRAME); NL80211_CMD_FRAME);
if (!hdr) {
if (IS_ERR(hdr)) { err = -ENOBUFS;
err = PTR_ERR(hdr);
goto free_msg; goto free_msg;
} }
} }
...@@ -8132,9 +8133,8 @@ static int nl80211_probe_client(struct sk_buff *skb, ...@@ -8132,9 +8133,8 @@ static int nl80211_probe_client(struct sk_buff *skb,
hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
NL80211_CMD_PROBE_CLIENT); NL80211_CMD_PROBE_CLIENT);
if (!hdr) {
if (IS_ERR(hdr)) { err = -ENOBUFS;
err = PTR_ERR(hdr);
goto free_msg; goto free_msg;
} }
......
...@@ -976,21 +976,19 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev, ...@@ -976,21 +976,19 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
struct net_device *dev, u16 reason, bool wextev) struct net_device *dev, u16 reason, bool wextev)
{ {
struct wireless_dev *wdev = dev->ieee80211_ptr; struct wireless_dev *wdev = dev->ieee80211_ptr;
int err; int err = 0;
ASSERT_WDEV_LOCK(wdev); ASSERT_WDEV_LOCK(wdev);
kfree(wdev->connect_keys); kfree(wdev->connect_keys);
wdev->connect_keys = NULL; wdev->connect_keys = NULL;
if (wdev->conn) { if (wdev->conn)
err = cfg80211_sme_disconnect(wdev, reason); err = cfg80211_sme_disconnect(wdev, reason);
} else if (!rdev->ops->disconnect) { else if (!rdev->ops->disconnect)
cfg80211_mlme_down(rdev, dev); cfg80211_mlme_down(rdev, dev);
err = 0; else if (wdev->current_bss)
} else {
err = rdev_disconnect(rdev, dev, reason); err = rdev_disconnect(rdev, dev, reason);
}
return err; return err;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment