]> git.baikalelectronics.ru Git - kernel.git/commit
wcn36xx: handle rx skb allocation failure to avoid system crash
authorFengwei Yin <fengwei.yin@linaro.org>
Sun, 20 Dec 2015 13:20:40 +0000 (21:20 +0800)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 7 Jan 2016 13:16:17 +0000 (15:16 +0200)
commit2002589283f8f3a09291ce1b86e8bf99327bc807
tree85f6ece21dc4e34061dfbdd600ca079e2add2775
parentc072030e67b9ad5ba3786a8bde6ca2a0dae1343a
wcn36xx: handle rx skb allocation failure to avoid system crash

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: King, Lawrence <lking@qti.qualcomm.com>
Signed-off-by: Fengwei Yin <fengwei.yin@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/wcn36xx/dxe.c