Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255860
b: refs/heads/master
c: 7f503fc
h: refs/heads/master
v: v3
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Jun 22, 2011
1 parent 7a06279 commit 3c23a9d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9c803a03bc07553f8148d024c15c784b28c1d9ee
refs/heads/master: 7f503fc49f144bb509dbd33daf3426df3f176e6b
13 changes: 13 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,18 @@ void rt2x00lib_rxdone(struct queue_entry *entry)
memset(&rxdesc, 0, sizeof(rxdesc));
rt2x00dev->ops->lib->fill_rxdone(entry, &rxdesc);

/*
* Check for valid size in case we get corrupted descriptor from
* hardware.
*/
if (unlikely(rxdesc.size == 0 ||
rxdesc.size > entry->queue->data_size)) {
WARNING(rt2x00dev, "Wrong frame size %d max %d.\n",
rxdesc.size, entry->queue->data_size);
dev_kfree_skb(entry->skb);
goto renew_skb;
}

/*
* The data behind the ieee80211 header must be
* aligned on a 4 byte boundary.
Expand Down Expand Up @@ -642,6 +654,7 @@ void rt2x00lib_rxdone(struct queue_entry *entry)

ieee80211_rx_ni(rt2x00dev->hw, entry->skb);

renew_skb:
/*
* Replace the skb with the freshly allocated one.
*/
Expand Down

0 comments on commit 3c23a9d

Please sign in to comment.