• Nicu Ioan Petru's avatar
    ucc_geth: fixes for ucc_geth_memclean · 3a8205ea
    Nicu Ioan Petru authored
    The ucc_geth_memclean function can be called before the Tx BD rings, Rx
    BD rings and associated socket buffers are allocated (for example if
    ucc_fast_init fails). The current code doesn't check if p_tx_bd_ring[i]
    is null, generating a kernel panic when trying to free the associated
    socket buffers.
    
    The function can also fail when accessing the uninitialized list_head
    structures ugeth->group_hash_q and ugeth->ind_hash_q. In the current
    implementation the list heads are initialized only when
    maxGroupAddrInHash and maxIndAddrInHash are positive values, although I
    think it's better to always initialize them.
    Signed-off-by: default avatarIonut Nicu <ionut.nicu@freescale.com>
    Signed-off-by: default avatarKim Phillips <kim.phillips@freescale.com>
    Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
    3a8205ea
ucc_geth.c 118 KB