linux/drivers/net/ethernet/marvell
Simon Guinot a84e328941 net: mvneta: fix refilling for Rx DMA buffers
With the actual code, if a memory allocation error happens while
refilling a Rx descriptor, then the original Rx buffer is both passed
to the networking stack (in a SKB) and let in the Rx ring. This leads
to various kernel oops and crashes.

As a fix, this patch moves Rx descriptor refilling ahead of building
SKB with the associated Rx buffer. In case of a memory allocation
failure, data is dropped and the original DMA buffer is put back into
the Rx ring.

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Fixes: c5aff18204 ("net: mvneta: driver for Marvell Armada 370/XP network unit")
Cc: <stable@vger.kernel.org> # v3.8+
Tested-by: Yoann Sculo <yoann@sculo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-07-21 00:30:02 -07:00
..
Kconfig drivers/net: remove all references to obsolete Ethernet-HOWTO 2015-06-23 06:50:35 -07:00
Makefile
mv643xx_eth.c net: mv643xx_eth: Use setup_timer 2015-05-31 21:23:28 -07:00
mvmdio.c
mvneta.c net: mvneta: fix refilling for Rx DMA buffers 2015-07-21 00:30:02 -07:00
mvpp2.c ethernet: codespell comment spelling fixes 2015-03-08 22:54:22 -04:00
pxa168_eth.c pxa168: fix double deallocation of managed resources 2015-04-26 16:05:49 -04:00
skge.c skge: Unmask interrupts in case of spurious interrupts 2014-12-05 21:33:19 -08:00
skge.h
sky2.c net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
sky2.h