]> git.baikalelectronics.ru Git - kernel.git/commit
net: axienet: Propagate failure of DMA descriptor setup
authorAndre Przywara <andre.przywara@arm.com>
Tue, 24 Mar 2020 13:23:36 +0000 (13:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Mar 2020 23:33:04 +0000 (16:33 -0700)
commit2189df0ce70e5e2d296516725ac7bb55a377898d
treeb932b426c620e1d2019e993663439f1b1170c675
parent41a5323a01c5fc1a6985bbb6ed47c9d3612c7b58
net: axienet: Propagate failure of DMA descriptor setup

When we fail allocating the DMA buffers in axienet_dma_bd_init(), we
report this error, but carry on with initialisation nevertheless.

This leads to a kernel panic when the driver later wants to send a
packet, as it uses uninitialised data structures.

Make the axienet_device_reset() routine return an error value, as it
contains the DMA buffer initialisation. Make sure we propagate the error
up the chain and eventually fail the driver initialisation, to avoid
relying on non-initialised buffers.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c