]> git.baikalelectronics.ru Git - kernel.git/commit
net: axienet: Improve DMA error handling
authorAndre Przywara <andre.przywara@arm.com>
Tue, 24 Mar 2020 13:23:38 +0000 (13:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Mar 2020 23:33:04 +0000 (16:33 -0700)
commit144b887cc2b697295a0b9fb02266dd82693a99fc
treeeac737f44e00e6c169ef95795517213aa8fede1c
parenta1d4134b8d560a6c4e6df2adbba47e80a19ea039
net: axienet: Improve DMA error handling

Since 0 is a valid DMA address, we cannot use the physical address to
check whether a TX descriptor is valid and is holding a DMA mapping.

Use the "cntrl" member of the descriptor to make this decision, as it
contains at least the length of the buffer, so 0 points to an
uninitialised buffer.

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