Changeset 35950


Ignore:
Timestamp:
2013-03-10T22:59:28+01:00 (5 years ago)
Author:
nbd
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c

    r35949 r35950  
    620620        unsigned int i = rx_ring->cur_index; 
    621621        struct rx_desc *desc = &(rx_ring)->desc[i]; 
    622  
    623         while (desc->cown) { 
     622        unsigned int alloc_count = rx_ring->alloc_count; 
     623 
     624        while (desc->cown && alloc_count + received < RX_DESCS - 1) { 
    624625                struct sk_buff *skb; 
    625626                int reserve = SKB_HEAD_ALIGN; 
Note: See TracChangeset for help on using the changeset viewer.