• Bryan Whitehead's avatar
    lan743x: Fix RX Kernel Panic · 22326473
    Bryan Whitehead authored
    [ Upstream commit dd9d9f59 ]
    
    It has been noticed that running the speed test at
    www.speedtest.net occasionally causes a kernel panic.
    
    Investigation revealed that under this test RX buffer allocation
    sometimes fails and returns NULL. But the lan743x driver did
    not handle this case.
    
    This patch fixes this issue by attempting to allocate a buffer
    before sending the new rx packet to the OS. If the allocation
    fails then the new rx packet is dropped and the existing buffer
    is reused in the DMA ring.
    
    Updates for v2:
        Additional 2 locations where allocation was not checked,
            has been changed to reuse existing buffer.
    
    Fixes: 23f0703c ("lan743x: Add main source files for new lan743x driver")
    Signed-off-by: default avatarBryan Whitehead <Bryan.Whitehead@microchip.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    22326473
lan743x_main.c 83.3 KB