diff options
-rw-r--r-- | net/wireless/nl80211.c | 22 | ||||
-rw-r--r-- | net/wireless/sme.c | 10 |
2 files changed, 15 insertions, 17 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 3fcba69817e5..5f6e982cdcf4 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -2622,8 +2622,8 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) | |||
2622 | 2622 | ||
2623 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, | 2623 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
2624 | NL80211_CMD_NEW_KEY); | 2624 | NL80211_CMD_NEW_KEY); |
2625 | if (IS_ERR(hdr)) | 2625 | if (!hdr) |
2626 | return PTR_ERR(hdr); | 2626 | return -ENOBUFS; |
2627 | 2627 | ||
2628 | cookie.msg = msg; | 2628 | cookie.msg = msg; |
2629 | cookie.idx = key_idx; | 2629 | cookie.idx = key_idx; |
@@ -6507,6 +6507,9 @@ static int nl80211_testmode_dump(struct sk_buff *skb, | |||
6507 | NL80211_CMD_TESTMODE); | 6507 | NL80211_CMD_TESTMODE); |
6508 | struct nlattr *tmdata; | 6508 | struct nlattr *tmdata; |
6509 | 6509 | ||
6510 | if (!hdr) | ||
6511 | break; | ||
6512 | |||
6510 | if (nla_put_u32(skb, NL80211_ATTR_WIPHY, phy_idx)) { | 6513 | if (nla_put_u32(skb, NL80211_ATTR_WIPHY, phy_idx)) { |
6511 | genlmsg_cancel(skb, hdr); | 6514 | genlmsg_cancel(skb, hdr); |
6512 | break; | 6515 | break; |
@@ -6951,9 +6954,8 @@ static int nl80211_remain_on_channel(struct sk_buff *skb, | |||
6951 | 6954 | ||
6952 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, | 6955 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
6953 | NL80211_CMD_REMAIN_ON_CHANNEL); | 6956 | NL80211_CMD_REMAIN_ON_CHANNEL); |
6954 | 6957 | if (!hdr) { | |
6955 | if (IS_ERR(hdr)) { | 6958 | err = -ENOBUFS; |
6956 | err = PTR_ERR(hdr); | ||
6957 | goto free_msg; | 6959 | goto free_msg; |
6958 | } | 6960 | } |
6959 | 6961 | ||
@@ -7251,9 +7253,8 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info) | |||
7251 | 7253 | ||
7252 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, | 7254 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
7253 | NL80211_CMD_FRAME); | 7255 | NL80211_CMD_FRAME); |
7254 | 7256 | if (!hdr) { | |
7255 | if (IS_ERR(hdr)) { | 7257 | err = -ENOBUFS; |
7256 | err = PTR_ERR(hdr); | ||
7257 | goto free_msg; | 7258 | goto free_msg; |
7258 | } | 7259 | } |
7259 | } | 7260 | } |
@@ -8132,9 +8133,8 @@ static int nl80211_probe_client(struct sk_buff *skb, | |||
8132 | 8133 | ||
8133 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, | 8134 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
8134 | NL80211_CMD_PROBE_CLIENT); | 8135 | NL80211_CMD_PROBE_CLIENT); |
8135 | 8136 | if (!hdr) { | |
8136 | if (IS_ERR(hdr)) { | 8137 | err = -ENOBUFS; |
8137 | err = PTR_ERR(hdr); | ||
8138 | goto free_msg; | 8138 | goto free_msg; |
8139 | } | 8139 | } |
8140 | 8140 | ||
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 81c8a10d743c..20e86a95dc4e 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c | |||
@@ -976,21 +976,19 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev, | |||
976 | struct net_device *dev, u16 reason, bool wextev) | 976 | struct net_device *dev, u16 reason, bool wextev) |
977 | { | 977 | { |
978 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 978 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
979 | int err; | 979 | int err = 0; |
980 | 980 | ||
981 | ASSERT_WDEV_LOCK(wdev); | 981 | ASSERT_WDEV_LOCK(wdev); |
982 | 982 | ||
983 | kfree(wdev->connect_keys); | 983 | kfree(wdev->connect_keys); |
984 | wdev->connect_keys = NULL; | 984 | wdev->connect_keys = NULL; |
985 | 985 | ||
986 | if (wdev->conn) { | 986 | if (wdev->conn) |
987 | err = cfg80211_sme_disconnect(wdev, reason); | 987 | err = cfg80211_sme_disconnect(wdev, reason); |
988 | } else if (!rdev->ops->disconnect) { | 988 | else if (!rdev->ops->disconnect) |
989 | cfg80211_mlme_down(rdev, dev); | 989 | cfg80211_mlme_down(rdev, dev); |
990 | err = 0; | 990 | else if (wdev->current_bss) |
991 | } else { | ||
992 | err = rdev_disconnect(rdev, dev, reason); | 991 | err = rdev_disconnect(rdev, dev, reason); |
993 | } | ||
994 | 992 | ||
995 | return err; | 993 | return err; |
996 | } | 994 | } |