cns3xxx: prevent the ethernet driver from accessing uninitialized dma descriptor entries

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35950 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Felix Fietkau 2013-03-10 21:59:28 +00:00
parent b019b3bb2f
commit 1bb86e38d7
1 changed files with 2 additions and 1 deletions

View File

@ -619,8 +619,9 @@ static int eth_poll(struct napi_struct *napi, int budget)
unsigned int length; unsigned int length;
unsigned int i = rx_ring->cur_index; unsigned int i = rx_ring->cur_index;
struct rx_desc *desc = &(rx_ring)->desc[i]; struct rx_desc *desc = &(rx_ring)->desc[i];
unsigned int alloc_count = rx_ring->alloc_count;
while (desc->cown) { while (desc->cown && alloc_count + received < RX_DESCS - 1) {
struct sk_buff *skb; struct sk_buff *skb;
int reserve = SKB_HEAD_ALIGN; int reserve = SKB_HEAD_ALIGN;