diff options
author | Aaro Koskinen <aaro.koskinen@nokia.com> | 2019-03-27 21:35:35 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-03-31 23:00:58 +0200 |
commit | 583e6361414903c5206258a30e5bd88cb03c0254 (patch) | |
tree | 5ec09545ea7f23e777609b40c7e3593408deb0c5 /drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c | |
parent | r8169: disable default rx interrupt coalescing on RTL8168 (diff) | |
download | linux-583e6361414903c5206258a30e5bd88cb03c0254.tar.xz linux-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/dwxgmac2_descs.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c index 1d858fdec997..98fa471da7c0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c @@ -123,7 +123,7 @@ static int dwxgmac2_get_rx_timestamp_status(void *desc, void *next_desc, } static void dwxgmac2_init_rx_desc(struct dma_desc *p, int disable_rx_ic, - int mode, int end) + int mode, int end, int bfsize) { dwxgmac2_set_rx_owner(p, disable_rx_ic); } |