]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: qcom/emac: specify the correct size when mapping a DMA buffer
authorTimur Tabi <timur@codeaurora.org>
Fri, 22 Sep 2017 20:32:44 +0000 (15:32 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2017 09:56:05 +0000 (11:56 +0200)
commit5e4038e83d88b36ad913b4e3cfd35c5337d30535
tree19df1d6170d21f11529a940c4699e95f9d81e83a
parent0476f91d987466884ba8c529aa29a839c4df3380
net: qcom/emac: specify the correct size when mapping a DMA buffer

[ Upstream commit a93ad944f4ff9a797abff17c73fc4b1e4a1d9141 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/qualcomm/emac/emac-mac.c