• Fengwei Yin's avatar
    wcn36xx: handle rx skb allocation failure to avoid system crash · 2ec7752f
    Fengwei Yin authored
    Lawrence reported that git clone could make system crash on a
    Qualcomm ARM soc based device (DragonBoard, 1G memory without
    swap) running 64bit Debian.
    
    It's turned out the crash is related with rx skb allocation
    failure. git could consume more than 600MB anonymous memory.
    And system is in extremely memory shortage case.
    
    But driver didn't handle the rx allocation failure case. This patch
    doesn't submit skb to upper layer if rx skb allocation fails.
    Instead, it reuse the old skb for rx DMA again. It's more like
    drop the packets if system is in memory shortage case.
    
    With this change, git clone is OOMed instead of system crash.
    Reported-by: default avatarKing, Lawrence <lking@qti.qualcomm.com>
    Signed-off-by: default avatarFengwei Yin <fengwei.yin@linaro.org>
    Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
    2ec7752f
dxe.c 21.7 KB