aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@nokia.com>2019-03-27 22:35:35 +0200
committerDavid S. Miller <davem@davemloft.net>2019-03-31 14:00:58 -0700
commit583e6361414903c5206258a30e5bd88cb03c0254 (patch)
tree5ec09545ea7f23e777609b40c7e3593408deb0c5 /drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
parentr8169: disable default rx interrupt coalescing on RTL8168 (diff)
downloadlinux-dev-583e6361414903c5206258a30e5bd88cb03c0254.tar.xz
linux-dev-583e6361414903c5206258a30e5bd88cb03c0254.zip
net: stmmac: use correct DMA buffer size in the RX descriptor
We always program the maximum DMA buffer size into the receive descriptor, although the allocated size may be less. E.g. with the default MTU size we allocate only 1536 bytes. If somebody sends us a bigger frame, then memory may get corrupted. Fix by using exact buffer sizes. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
index 7fbb6a4dbf51..e061e9f5fad7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
@@ -296,7 +296,7 @@ exit:
}
static void dwmac4_rd_init_rx_desc(struct dma_desc *p, int disable_rx_ic,
- int mode, int end)
+ int mode, int end, int bfsize)
{
dwmac4_set_rx_owner(p, disable_rx_ic);
}