]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 9 Nov 2020 13:47:41 +0000 (14:47 +0100)
commit3e3ecdfcabd76e8c59bced0ea1ac6c24504af460
treee510704ef21d694629cfb5c72662f3bb4e87935a
parentbf4d31969d96006df246e5ec79e225263e4a8796
net: axienet: Propagate failure of DMA descriptor setup

BugLink: https://bugs.launchpad.net/bugs/1900624
[ Upstream commit ee44d0b78839b21591501424fd3cb3648cc803b5 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c