aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Tabi <timur@codeaurora.org>2017-09-22 16:32:44 -0400
committerDavid S. Miller <davem@davemloft.net>2017-09-25 19:34:29 -0400
commita93ad944f4ff9a797abff17c73fc4b1e4a1d9141 (patch)
treef19fb521b0796cc2af5ff3b3e20a148ca3a3f564
parent016576d531c1923f604a0f8410312c39e25b26a1 (diff)
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: b9b17debc69d ("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>
-rw-r--r--drivers/net/ethernet/qualcomm/emac/emac-mac.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-mac.c b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
index 0ea3ca09c689..3ed9033e56db 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-mac.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
@@ -898,7 +898,8 @@ static void emac_mac_rx_descs_refill(struct emac_adapter *adpt,
898 898
899 curr_rxbuf->dma_addr = 899 curr_rxbuf->dma_addr =
900 dma_map_single(adpt->netdev->dev.parent, skb->data, 900 dma_map_single(adpt->netdev->dev.parent, skb->data,
901 curr_rxbuf->length, DMA_FROM_DEVICE); 901 adpt->rxbuf_size, DMA_FROM_DEVICE);
902
902 ret = dma_mapping_error(adpt->netdev->dev.parent, 903 ret = dma_mapping_error(adpt->netdev->dev.parent,
903 curr_rxbuf->dma_addr); 904 curr_rxbuf->dma_addr);
904 if (ret) { 905 if (ret) {