]> 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)
commit21243e3ab457e7431b88eb9d351933506e7ff030
tree85f6ece21dc4e34061dfbdd600ca079e2add2775
parent709168fadad3da9db9ff93ee92524c196981e179
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