diff options
author | David S. Miller <davem@davemloft.net> | 2013-08-26 16:37:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-26 16:37:08 -0400 |
commit | b05930f5d1c7d5873cb050261d21789a99de9d48 (patch) | |
tree | 2d374846712b0bdacc5dd0a36b3c2f754886e560 /net | |
parent | b65f63ee845136940db985f3072335d8cdb6fd6c (diff) | |
parent | 41a00f7950a6bc0aa956f6d6b423f0fbf34d431a (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/wireless/iwlwifi/pcie/trans.c
include/linux/inetdevice.h
The inetdevice.h conflict involves moving the IPV4_DEVCONF values
into a UAPI header, overlapping additions of some new entries.
The iwlwifi conflict is a context overlap.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/batman-adv/unicast.c | 10 | ||||
-rw-r--r-- | net/bridge/br_fdb.c | 10 | ||||
-rw-r--r-- | net/bridge/br_netlink.c | 4 | ||||
-rw-r--r-- | net/bridge/br_vlan.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 7 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 10 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 4 | ||||
-rw-r--r-- | net/ipv6/reassembly.c | 5 | ||||
-rw-r--r-- | net/ipv6/route.c | 21 | ||||
-rw-r--r-- | net/netlink/genetlink.c | 7 | ||||
-rw-r--r-- | net/packet/af_packet.c | 2 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 22 | ||||
-rw-r--r-- | net/wireless/sme.c | 10 |
13 files changed, 73 insertions, 43 deletions
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c index 688a0419756b..857e1b8349ee 100644 --- a/net/batman-adv/unicast.c +++ b/net/batman-adv/unicast.c | |||
@@ -432,12 +432,16 @@ find_router: | |||
432 | 432 | ||
433 | switch (packet_type) { | 433 | switch (packet_type) { |
434 | case BATADV_UNICAST: | 434 | case BATADV_UNICAST: |
435 | batadv_unicast_prepare_skb(skb, orig_node); | 435 | if (!batadv_unicast_prepare_skb(skb, orig_node)) |
436 | goto out; | ||
437 | |||
436 | header_len = sizeof(struct batadv_unicast_packet); | 438 | header_len = sizeof(struct batadv_unicast_packet); |
437 | break; | 439 | break; |
438 | case BATADV_UNICAST_4ADDR: | 440 | case BATADV_UNICAST_4ADDR: |
439 | batadv_unicast_4addr_prepare_skb(bat_priv, skb, orig_node, | 441 | if (!batadv_unicast_4addr_prepare_skb(bat_priv, skb, orig_node, |
440 | packet_subtype); | 442 | packet_subtype)) |
443 | goto out; | ||
444 | |||
441 | header_len = sizeof(struct batadv_unicast_4addr_packet); | 445 | header_len = sizeof(struct batadv_unicast_4addr_packet); |
442 | break; | 446 | break; |
443 | default: | 447 | default: |
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 60aca9109a50..ffd5874f2592 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c | |||
@@ -161,7 +161,7 @@ void br_fdb_change_mac_address(struct net_bridge *br, const u8 *newaddr) | |||
161 | if (!pv) | 161 | if (!pv) |
162 | return; | 162 | return; |
163 | 163 | ||
164 | for_each_set_bit_from(vid, pv->vlan_bitmap, BR_VLAN_BITMAP_LEN) { | 164 | for_each_set_bit_from(vid, pv->vlan_bitmap, VLAN_N_VID) { |
165 | f = __br_fdb_get(br, br->dev->dev_addr, vid); | 165 | f = __br_fdb_get(br, br->dev->dev_addr, vid); |
166 | if (f && f->is_local && !f->dst) | 166 | if (f && f->is_local && !f->dst) |
167 | fdb_delete(br, f); | 167 | fdb_delete(br, f); |
@@ -730,7 +730,7 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], | |||
730 | /* VID was specified, so use it. */ | 730 | /* VID was specified, so use it. */ |
731 | err = __br_fdb_add(ndm, p, addr, nlh_flags, vid); | 731 | err = __br_fdb_add(ndm, p, addr, nlh_flags, vid); |
732 | } else { | 732 | } else { |
733 | if (!pv || bitmap_empty(pv->vlan_bitmap, BR_VLAN_BITMAP_LEN)) { | 733 | if (!pv || bitmap_empty(pv->vlan_bitmap, VLAN_N_VID)) { |
734 | err = __br_fdb_add(ndm, p, addr, nlh_flags, 0); | 734 | err = __br_fdb_add(ndm, p, addr, nlh_flags, 0); |
735 | goto out; | 735 | goto out; |
736 | } | 736 | } |
@@ -739,7 +739,7 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], | |||
739 | * specify a VLAN. To be nice, add/update entry for every | 739 | * specify a VLAN. To be nice, add/update entry for every |
740 | * vlan on this port. | 740 | * vlan on this port. |
741 | */ | 741 | */ |
742 | for_each_set_bit(vid, pv->vlan_bitmap, BR_VLAN_BITMAP_LEN) { | 742 | for_each_set_bit(vid, pv->vlan_bitmap, VLAN_N_VID) { |
743 | err = __br_fdb_add(ndm, p, addr, nlh_flags, vid); | 743 | err = __br_fdb_add(ndm, p, addr, nlh_flags, vid); |
744 | if (err) | 744 | if (err) |
745 | goto out; | 745 | goto out; |
@@ -817,7 +817,7 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], | |||
817 | 817 | ||
818 | err = __br_fdb_delete(p, addr, vid); | 818 | err = __br_fdb_delete(p, addr, vid); |
819 | } else { | 819 | } else { |
820 | if (!pv || bitmap_empty(pv->vlan_bitmap, BR_VLAN_BITMAP_LEN)) { | 820 | if (!pv || bitmap_empty(pv->vlan_bitmap, VLAN_N_VID)) { |
821 | err = __br_fdb_delete(p, addr, 0); | 821 | err = __br_fdb_delete(p, addr, 0); |
822 | goto out; | 822 | goto out; |
823 | } | 823 | } |
@@ -827,7 +827,7 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], | |||
827 | * vlan on this port. | 827 | * vlan on this port. |
828 | */ | 828 | */ |
829 | err = -ENOENT; | 829 | err = -ENOENT; |
830 | for_each_set_bit(vid, pv->vlan_bitmap, BR_VLAN_BITMAP_LEN) { | 830 | for_each_set_bit(vid, pv->vlan_bitmap, VLAN_N_VID) { |
831 | err &= __br_fdb_delete(p, addr, vid); | 831 | err &= __br_fdb_delete(p, addr, vid); |
832 | } | 832 | } |
833 | } | 833 | } |
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index 1fc30abd3a52..b9259efa636e 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c | |||
@@ -132,7 +132,7 @@ static int br_fill_ifinfo(struct sk_buff *skb, | |||
132 | else | 132 | else |
133 | pv = br_get_vlan_info(br); | 133 | pv = br_get_vlan_info(br); |
134 | 134 | ||
135 | if (!pv || bitmap_empty(pv->vlan_bitmap, BR_VLAN_BITMAP_LEN)) | 135 | if (!pv || bitmap_empty(pv->vlan_bitmap, VLAN_N_VID)) |
136 | goto done; | 136 | goto done; |
137 | 137 | ||
138 | af = nla_nest_start(skb, IFLA_AF_SPEC); | 138 | af = nla_nest_start(skb, IFLA_AF_SPEC); |
@@ -140,7 +140,7 @@ static int br_fill_ifinfo(struct sk_buff *skb, | |||
140 | goto nla_put_failure; | 140 | goto nla_put_failure; |
141 | 141 | ||
142 | pvid = br_get_pvid(pv); | 142 | pvid = br_get_pvid(pv); |
143 | for_each_set_bit(vid, pv->vlan_bitmap, BR_VLAN_BITMAP_LEN) { | 143 | for_each_set_bit(vid, pv->vlan_bitmap, VLAN_N_VID) { |
144 | vinfo.vid = vid; | 144 | vinfo.vid = vid; |
145 | vinfo.flags = 0; | 145 | vinfo.flags = 0; |
146 | if (vid == pvid) | 146 | if (vid == pvid) |
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c index bd58b45f5f90..9a9ffe7e4019 100644 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c | |||
@@ -108,7 +108,7 @@ static int __vlan_del(struct net_port_vlans *v, u16 vid) | |||
108 | 108 | ||
109 | clear_bit(vid, v->vlan_bitmap); | 109 | clear_bit(vid, v->vlan_bitmap); |
110 | v->num_vlans--; | 110 | v->num_vlans--; |
111 | if (bitmap_empty(v->vlan_bitmap, BR_VLAN_BITMAP_LEN)) { | 111 | if (bitmap_empty(v->vlan_bitmap, VLAN_N_VID)) { |
112 | if (v->port_idx) | 112 | if (v->port_idx) |
113 | rcu_assign_pointer(v->parent.port->vlan_info, NULL); | 113 | rcu_assign_pointer(v->parent.port->vlan_info, NULL); |
114 | else | 114 | else |
@@ -122,7 +122,7 @@ static void __vlan_flush(struct net_port_vlans *v) | |||
122 | { | 122 | { |
123 | smp_wmb(); | 123 | smp_wmb(); |
124 | v->pvid = 0; | 124 | v->pvid = 0; |
125 | bitmap_zero(v->vlan_bitmap, BR_VLAN_BITMAP_LEN); | 125 | bitmap_zero(v->vlan_bitmap, VLAN_N_VID); |
126 | if (v->port_idx) | 126 | if (v->port_idx) |
127 | rcu_assign_pointer(v->parent.port->vlan_info, NULL); | 127 | rcu_assign_pointer(v->parent.port->vlan_info, NULL); |
128 | else | 128 | else |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index ab64eea042fa..4e42c03859f4 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -1117,6 +1117,13 @@ new_segment: | |||
1117 | goto wait_for_memory; | 1117 | goto wait_for_memory; |
1118 | 1118 | ||
1119 | /* | 1119 | /* |
1120 | * All packets are restored as if they have | ||
1121 | * already been sent. | ||
1122 | */ | ||
1123 | if (tp->repair) | ||
1124 | TCP_SKB_CB(skb)->when = tcp_time_stamp; | ||
1125 | |||
1126 | /* | ||
1120 | * Check whether we can use HW checksum. | 1127 | * Check whether we can use HW checksum. |
1121 | */ | 1128 | */ |
1122 | if (sk->sk_route_caps & NETIF_F_ALL_CSUM) | 1129 | if (sk->sk_route_caps & NETIF_F_ALL_CSUM) |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 8549a5d0d167..2d6d1793bbfe 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1131,12 +1131,10 @@ retry: | |||
1131 | if (ifp->flags & IFA_F_OPTIMISTIC) | 1131 | if (ifp->flags & IFA_F_OPTIMISTIC) |
1132 | addr_flags |= IFA_F_OPTIMISTIC; | 1132 | addr_flags |= IFA_F_OPTIMISTIC; |
1133 | 1133 | ||
1134 | ift = !max_addresses || | 1134 | ift = ipv6_add_addr(idev, &addr, NULL, tmp_plen, |
1135 | ipv6_count_addresses(idev) < max_addresses ? | 1135 | ipv6_addr_scope(&addr), addr_flags, |
1136 | ipv6_add_addr(idev, &addr, NULL, tmp_plen, | 1136 | tmp_valid_lft, tmp_prefered_lft); |
1137 | ipv6_addr_scope(&addr), addr_flags, | 1137 | if (IS_ERR(ift)) { |
1138 | tmp_valid_lft, tmp_prefered_lft) : NULL; | ||
1139 | if (IS_ERR_OR_NULL(ift)) { | ||
1140 | in6_ifa_put(ifp); | 1138 | in6_ifa_put(ifp); |
1141 | in6_dev_put(idev); | 1139 | in6_dev_put(idev); |
1142 | pr_info("%s: retry temporary address regeneration\n", __func__); | 1140 | pr_info("%s: retry temporary address regeneration\n", __func__); |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 79aa9652ed86..04d31c2fbef1 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -1369,8 +1369,10 @@ static void ndisc_redirect_rcv(struct sk_buff *skb) | |||
1369 | if (!ndisc_parse_options(msg->opt, ndoptlen, &ndopts)) | 1369 | if (!ndisc_parse_options(msg->opt, ndoptlen, &ndopts)) |
1370 | return; | 1370 | return; |
1371 | 1371 | ||
1372 | if (!ndopts.nd_opts_rh) | 1372 | if (!ndopts.nd_opts_rh) { |
1373 | ip6_redirect_no_header(skb, dev_net(skb->dev), 0, 0); | ||
1373 | return; | 1374 | return; |
1375 | } | ||
1374 | 1376 | ||
1375 | hdr = (u8 *)ndopts.nd_opts_rh; | 1377 | hdr = (u8 *)ndopts.nd_opts_rh; |
1376 | hdr += 8; | 1378 | hdr += 8; |
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 790d9f4b8b0b..1aeb473b2cc6 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -490,6 +490,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, | |||
490 | ipv6_hdr(head)->payload_len = htons(payload_len); | 490 | ipv6_hdr(head)->payload_len = htons(payload_len); |
491 | ipv6_change_dsfield(ipv6_hdr(head), 0xff, ecn); | 491 | ipv6_change_dsfield(ipv6_hdr(head), 0xff, ecn); |
492 | IP6CB(head)->nhoff = nhoff; | 492 | IP6CB(head)->nhoff = nhoff; |
493 | IP6CB(head)->flags |= IP6SKB_FRAGMENTED; | ||
493 | 494 | ||
494 | /* Yes, and fold redundant checksum back. 8) */ | 495 | /* Yes, and fold redundant checksum back. 8) */ |
495 | if (head->ip_summed == CHECKSUM_COMPLETE) | 496 | if (head->ip_summed == CHECKSUM_COMPLETE) |
@@ -524,6 +525,9 @@ static int ipv6_frag_rcv(struct sk_buff *skb) | |||
524 | struct net *net = dev_net(skb_dst(skb)->dev); | 525 | struct net *net = dev_net(skb_dst(skb)->dev); |
525 | int evicted; | 526 | int evicted; |
526 | 527 | ||
528 | if (IP6CB(skb)->flags & IP6SKB_FRAGMENTED) | ||
529 | goto fail_hdr; | ||
530 | |||
527 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMREQDS); | 531 | IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMREQDS); |
528 | 532 | ||
529 | /* Jumbo payload inhibits frag. header */ | 533 | /* Jumbo payload inhibits frag. header */ |
@@ -544,6 +548,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb) | |||
544 | ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMOKS); | 548 | ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMOKS); |
545 | 549 | ||
546 | IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb); | 550 | IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb); |
551 | IP6CB(skb)->flags |= IP6SKB_FRAGMENTED; | ||
547 | return 1; | 552 | return 1; |
548 | } | 553 | } |
549 | 554 | ||
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index e22c4db8d07a..55236a84c748 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -1177,6 +1177,27 @@ void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark) | |||
1177 | } | 1177 | } |
1178 | EXPORT_SYMBOL_GPL(ip6_redirect); | 1178 | EXPORT_SYMBOL_GPL(ip6_redirect); |
1179 | 1179 | ||
1180 | void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif, | ||
1181 | u32 mark) | ||
1182 | { | ||
1183 | const struct ipv6hdr *iph = ipv6_hdr(skb); | ||
1184 | const struct rd_msg *msg = (struct rd_msg *)icmp6_hdr(skb); | ||
1185 | struct dst_entry *dst; | ||
1186 | struct flowi6 fl6; | ||
1187 | |||
1188 | memset(&fl6, 0, sizeof(fl6)); | ||
1189 | fl6.flowi6_oif = oif; | ||
1190 | fl6.flowi6_mark = mark; | ||
1191 | fl6.flowi6_flags = 0; | ||
1192 | fl6.daddr = msg->dest; | ||
1193 | fl6.saddr = iph->daddr; | ||
1194 | |||
1195 | dst = ip6_route_output(net, NULL, &fl6); | ||
1196 | if (!dst->error) | ||
1197 | rt6_do_redirect(dst, NULL, skb); | ||
1198 | dst_release(dst); | ||
1199 | } | ||
1200 | |||
1180 | void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk) | 1201 | void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk) |
1181 | { | 1202 | { |
1182 | ip6_redirect(skb, sock_net(sk), sk->sk_bound_dev_if, sk->sk_mark); | 1203 | ip6_redirect(skb, sock_net(sk), sk->sk_bound_dev_if, sk->sk_mark); |
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index f85f8a2ad6cf..512718adb0d5 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -789,10 +789,6 @@ static int ctrl_dumpfamily(struct sk_buff *skb, struct netlink_callback *cb) | |||
789 | struct net *net = sock_net(skb->sk); | 789 | struct net *net = sock_net(skb->sk); |
790 | int chains_to_skip = cb->args[0]; | 790 | int chains_to_skip = cb->args[0]; |
791 | int fams_to_skip = cb->args[1]; | 791 | int fams_to_skip = cb->args[1]; |
792 | bool need_locking = chains_to_skip || fams_to_skip; | ||
793 | |||
794 | if (need_locking) | ||
795 | genl_lock(); | ||
796 | 792 | ||
797 | for (i = chains_to_skip; i < GENL_FAM_TAB_SIZE; i++) { | 793 | for (i = chains_to_skip; i < GENL_FAM_TAB_SIZE; i++) { |
798 | n = 0; | 794 | n = 0; |
@@ -814,9 +810,6 @@ errout: | |||
814 | cb->args[0] = i; | 810 | cb->args[0] = i; |
815 | cb->args[1] = n; | 811 | cb->args[1] = n; |
816 | 812 | ||
817 | if (need_locking) | ||
818 | genl_unlock(); | ||
819 | |||
820 | return skb->len; | 813 | return skb->len; |
821 | } | 814 | } |
822 | 815 | ||
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 6c53dd9f5ccc..1fdf9ab91c3f 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -3215,9 +3215,11 @@ static int packet_getsockopt(struct socket *sock, int level, int optname, | |||
3215 | 3215 | ||
3216 | if (po->tp_version == TPACKET_V3) { | 3216 | if (po->tp_version == TPACKET_V3) { |
3217 | lv = sizeof(struct tpacket_stats_v3); | 3217 | lv = sizeof(struct tpacket_stats_v3); |
3218 | st.stats3.tp_packets += st.stats3.tp_drops; | ||
3218 | data = &st.stats3; | 3219 | data = &st.stats3; |
3219 | } else { | 3220 | } else { |
3220 | lv = sizeof(struct tpacket_stats); | 3221 | lv = sizeof(struct tpacket_stats); |
3222 | st.stats1.tp_packets += st.stats1.tp_drops; | ||
3221 | data = &st.stats1; | 3223 | data = &st.stats1; |
3222 | } | 3224 | } |
3223 | 3225 | ||
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index adf1e98f4c3e..170c0abd2a01 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -2664,8 +2664,8 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) | |||
2664 | 2664 | ||
2665 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, | 2665 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
2666 | NL80211_CMD_NEW_KEY); | 2666 | NL80211_CMD_NEW_KEY); |
2667 | if (IS_ERR(hdr)) | 2667 | if (!hdr) |
2668 | return PTR_ERR(hdr); | 2668 | return -ENOBUFS; |
2669 | 2669 | ||
2670 | cookie.msg = msg; | 2670 | cookie.msg = msg; |
2671 | cookie.idx = key_idx; | 2671 | cookie.idx = key_idx; |
@@ -6670,6 +6670,9 @@ static int nl80211_testmode_dump(struct sk_buff *skb, | |||
6670 | NL80211_CMD_TESTMODE); | 6670 | NL80211_CMD_TESTMODE); |
6671 | struct nlattr *tmdata; | 6671 | struct nlattr *tmdata; |
6672 | 6672 | ||
6673 | if (!hdr) | ||
6674 | break; | ||
6675 | |||
6673 | if (nla_put_u32(skb, NL80211_ATTR_WIPHY, phy_idx)) { | 6676 | if (nla_put_u32(skb, NL80211_ATTR_WIPHY, phy_idx)) { |
6674 | genlmsg_cancel(skb, hdr); | 6677 | genlmsg_cancel(skb, hdr); |
6675 | break; | 6678 | break; |
@@ -7114,9 +7117,8 @@ static int nl80211_remain_on_channel(struct sk_buff *skb, | |||
7114 | 7117 | ||
7115 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, | 7118 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
7116 | NL80211_CMD_REMAIN_ON_CHANNEL); | 7119 | NL80211_CMD_REMAIN_ON_CHANNEL); |
7117 | 7120 | if (!hdr) { | |
7118 | if (IS_ERR(hdr)) { | 7121 | err = -ENOBUFS; |
7119 | err = PTR_ERR(hdr); | ||
7120 | goto free_msg; | 7122 | goto free_msg; |
7121 | } | 7123 | } |
7122 | 7124 | ||
@@ -7414,9 +7416,8 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info) | |||
7414 | 7416 | ||
7415 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, | 7417 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
7416 | NL80211_CMD_FRAME); | 7418 | NL80211_CMD_FRAME); |
7417 | 7419 | if (!hdr) { | |
7418 | if (IS_ERR(hdr)) { | 7420 | err = -ENOBUFS; |
7419 | err = PTR_ERR(hdr); | ||
7420 | goto free_msg; | 7421 | goto free_msg; |
7421 | } | 7422 | } |
7422 | } | 7423 | } |
@@ -8551,9 +8552,8 @@ static int nl80211_probe_client(struct sk_buff *skb, | |||
8551 | 8552 | ||
8552 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, | 8553 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
8553 | NL80211_CMD_PROBE_CLIENT); | 8554 | NL80211_CMD_PROBE_CLIENT); |
8554 | 8555 | if (!hdr) { | |
8555 | if (IS_ERR(hdr)) { | 8556 | err = -ENOBUFS; |
8556 | err = PTR_ERR(hdr); | ||
8557 | goto free_msg; | 8557 | goto free_msg; |
8558 | } | 8558 | } |
8559 | 8559 | ||
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 | } |