kernel_samsung_a53x/drivers/net/ethernet/renesas
Nikita Yushchenko cf1cf0cab4 net: ravb: Fix dma_addr_t truncation in error case
[ Upstream commit e327b2372bc0f18c30433ac40be07741b59231c5 ]

In ravb_start_xmit(), ravb driver uses u32 variable to store result of
dma_map_single() call. Since ravb hardware has 32-bit address fields in
descriptors, this works properly when mapping is successful - it is
platform's job to provide mapping addresses that fit into hardware
limitations.

However, in failure case dma_map_single() returns DMA_MAPPING_ERROR
constant that is 64-bit when dma_addr_t is 64-bit. Storing this constant
in u32 leads to truncation, and further call to dma_mapping_error()
fails to notice the error.

Fix that by storing result of dma_map_single() in a dma_addr_t
variable.

Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper")
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 12:12:51 +01:00
..
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ravb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ravb_main.c net: ravb: Fix dma_addr_t truncation in error case 2024-11-18 12:12:51 +01:00
ravb_ptp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sh_eth.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
sh_eth.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00