]> rtime.felk.cvut.cz Git - zynq/linux.git/blobdiff - drivers/net/ethernet/cadence/macb.c
net: macb: Fix race condition in driver when Rx frame is dropped
[zynq/linux.git] / drivers / net / ethernet / cadence / macb.c
index caa94a1b8a0db8cfbb87235b41e26ca004dae60f..48522a0232436c0d017d1c9ce0d3972096bd88cb 100644 (file)
@@ -707,6 +707,9 @@ static void gem_rx_refill(struct macb *bp)
 
                        /* properly align Ethernet header */
                        skb_reserve(skb, NET_IP_ALIGN);
+               } else {
+                       bp->rx_ring[entry].addr &= ~MACB_BIT(RX_USED);
+                       bp->rx_ring[entry].ctrl = 0;
                }
        }