diff options
author | Aaro Koskinen <aaro.koskinen@nokia.com> | 2019-03-27 22:35:35 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-03-31 14:00:58 -0700 |
commit | 583e6361414903c5206258a30e5bd88cb03c0254 (patch) | |
tree | 5ec09545ea7f23e777609b40c7e3593408deb0c5 /drivers/net/ethernet/stmicro/stmmac/hwif.h | |
parent | r8169: disable default rx interrupt coalescing on RTL8168 (diff) | |
download | linux-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/hwif.h')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/hwif.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h index 92b8944f26e3..5bb00234d961 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h @@ -33,7 +33,7 @@ struct dma_extended_desc; struct stmmac_desc_ops { /* DMA RX descriptor ring initialization */ void (*init_rx_desc)(struct dma_desc *p, int disable_rx_ic, int mode, - int end); + int end, int bfsize); /* DMA TX descriptor ring initialization */ void (*init_tx_desc)(struct dma_desc *p, int mode, int end); /* Invoked by the xmit function to prepare the tx descriptor */ |