Home
last modified time | relevance | path

Searched hist:"52 e597d3e2e6e5bfce47559eb22b955ac17b3826" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/net/ethernet/stmicro/stmmac/
H A Dstmmac.hdiff 52e597d3e2e6e5bfce47559eb22b955ac17b3826 Fri Jun 11 04:02:38 CDT 2021 Wong Vee Khee <vee.khee.wong@linux.intel.com> net: stmmac: Fix potential integer overflow

The commit d96febedfde2 ("net: stmmac: arrange Tx tail pointer update
to stmmac_flush_tx_descriptors") introduced the following coverity
warning:-

1. Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression
'tx_q->cur_tx * desc_size' with type 'unsigned int' (32 bits,
unsigned) is evaluated using 32-bit arithmetic, and then used in a
context that expects an expression of type dma_addr_t (64 bits,
unsigned).

Fixed this by assigning tx_tail_addr to dma_addr_t type, as dma_addr_t
datatype is decided by CONFIG_ARCH_DMA_ADDR_T_64_BIT.

Fixes: d96febedfde2 ("net: stmmac: arrange Tx tail pointer update to stmmac_flush_tx_descriptors")
Signed-off-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>