Skip to content

Commit a93ad94

Browse files
Timur Tabidavem330
authored andcommitted
net: qcom/emac: specify the correct size when mapping a DMA buffer
When mapping the RX DMA buffers, the driver was accidentally specifying zero for the buffer length. Under normal circumstances, SWIOTLB does not need to allocate a bounce buffer, so the address is just mapped without checking the size field. This is why the error was not detected earlier. Fixes: b9b17de ("net: emac: emac gigabit ethernet controller driver") Cc: stable@vger.kernel.org Signed-off-by: Timur Tabi <timur@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 016576d commit a93ad94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/qualcomm/emac/emac-mac.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,8 @@ static void emac_mac_rx_descs_refill(struct emac_adapter *adpt,
898898

899899
curr_rxbuf->dma_addr =
900900
dma_map_single(adpt->netdev->dev.parent, skb->data,
901-
curr_rxbuf->length, DMA_FROM_DEVICE);
901+
adpt->rxbuf_size, DMA_FROM_DEVICE);
902+
902903
ret = dma_mapping_error(adpt->netdev->dev.parent,
903904
curr_rxbuf->dma_addr);
904905
if (ret) {

0 commit comments

Comments
 (0)