linux/drivers/net/ethernet/xilinx
Andre Przywara f26667a373 net: axienet: Fix DMA descriptor cleanup path
When axienet_dma_bd_init() bails out during the initialisation process,
it might do so with parts of the structure already allocated and
initialised, while other parts have not been touched yet. Before
returning in this case, we call axienet_dma_bd_release(), which does not
take care of this corner case.
This is most obvious by the first loop happily dereferencing
lp->rx_bd_v, which we actually check to be non NULL *afterwards*.

Make sure we only unmap or free already allocated structures, by:
- directly returning with -ENOMEM if nothing has been allocated at all
- checking for lp->rx_bd_v to be non-NULL *before* using it
- only unmapping allocated DMA RX regions

This avoids NULL pointer dereferences when initialisation fails.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-24 16:33:04 -07:00
..
Kconfig net: xilinx: temac: Relax Kconfig dependencies 2020-03-24 16:33:04 -07:00
ll_temac_main.c net: ll_temac: let core reject the unsupported coalescing parameters 2020-03-17 20:56:58 -07:00
ll_temac_mdio.c net: ll_temac: Prepare indirect register access for multicast support 2019-05-23 09:33:57 -07:00
ll_temac.h net: ll_temac: Add ethtool support for coalesce parameters 2020-02-29 21:30:43 -08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xilinx_axienet_main.c net: axienet: Fix DMA descriptor cleanup path 2020-03-24 16:33:04 -07:00
xilinx_axienet_mdio.c net: axienet: Fix MDIO bus parent node detection 2019-06-06 16:24:30 -07:00
xilinx_axienet.h net: axienet: Convert DMA error handler to a work queue 2020-03-24 16:33:04 -07:00
xilinx_emaclite.c netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00