diff options
author | Luis Carlos Cobo <luisca@cozybit.com> | 2008-05-05 15:29:42 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-12 21:22:18 -0400 |
commit | 69687a0b9934942e61bf8148c242adea87183a5b (patch) | |
tree | a235fcc6f21a97c95ff2c58d3f13fa129370b84d | |
parent | ef269254772a0d2253c85cafe160e3f6528eb292 (diff) |
mac80211: fix access to null skb
Without this patch, if xmit_skb is null but net_ratelimit() returns 0 we would
go to the else branch and access the null xmit_skb. Pointed out by Johannes
Berg.
Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/rx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 02f436a86061..9c57b3af0244 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1305,11 +1305,11 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx) | |||
1305 | if (is_multicast_ether_addr(skb->data)) { | 1305 | if (is_multicast_ether_addr(skb->data)) { |
1306 | if (*mesh_ttl > 0) { | 1306 | if (*mesh_ttl > 0) { |
1307 | xmit_skb = skb_copy(skb, GFP_ATOMIC); | 1307 | xmit_skb = skb_copy(skb, GFP_ATOMIC); |
1308 | if (!xmit_skb && net_ratelimit()) | 1308 | if (xmit_skb) |
1309 | xmit_skb->pkt_type = PACKET_OTHERHOST; | ||
1310 | else if (net_ratelimit()) | ||
1309 | printk(KERN_DEBUG "%s: failed to clone " | 1311 | printk(KERN_DEBUG "%s: failed to clone " |
1310 | "multicast frame\n", dev->name); | 1312 | "multicast frame\n", dev->name); |
1311 | else | ||
1312 | xmit_skb->pkt_type = PACKET_OTHERHOST; | ||
1313 | } else | 1313 | } else |
1314 | IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.sta, | 1314 | IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.sta, |
1315 | dropped_frames_ttl); | 1315 | dropped_frames_ttl); |