diff options
author | Jose Abreu <Jose.Abreu@synopsys.com> | 2019-12-18 11:17:38 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-12-18 21:04:17 +0100 |
commit | 93b5dce401ccd4a688fe1f0d0bf0d97e63cdf921 (patch) | |
tree | 5d4b047423758e94fb4634ff51c7ad24f2fa0d9e /drivers | |
parent | net: stmmac: Do not accept invalid MTU values (diff) | |
download | linux-93b5dce401ccd4a688fe1f0d0bf0d97e63cdf921.tar.xz linux-93b5dce401ccd4a688fe1f0d0bf0d97e63cdf921.zip |
net: stmmac: Only the last buffer has the FCS field
Only the last received buffer contains the FCS field. Check for end of
packet before trying to strip the FCS field.
Fixes: 88ebe2cf7f3f ("net: stmmac: Rework stmmac_rx()")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 8b7861909ef9..acb14a96243e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3644,8 +3644,9 @@ read_again: * feature is always disabled and packets need to be * stripped manually. */ - if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00) || - unlikely(status != llc_snap)) { + if (likely(!(status & rx_not_ls)) && + (likely(priv->synopsys_id >= DWMAC_CORE_4_00) || + unlikely(status != llc_snap))) { if (buf2_len) buf2_len -= ETH_FCS_LEN; else |