|
@@ -2232,6 +2232,12 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit)
|
|
|
|
|
|
|
|
frame_len = priv->hw->desc->get_rx_frame_len(p, coe);
|
|
frame_len = priv->hw->desc->get_rx_frame_len(p, coe);
|
|
|
|
|
|
|
|
|
|
+ /* check if frame_len fits the preallocated memory */
|
|
|
|
|
+ if (frame_len > priv->dma_buf_sz) {
|
|
|
|
|
+ priv->dev->stats.rx_length_errors++;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/* ACS is set; GMAC core strips PAD/FCS for IEEE 802.3
|
|
/* ACS is set; GMAC core strips PAD/FCS for IEEE 802.3
|
|
|
* Type frames (LLC/LLC-SNAP)
|
|
* Type frames (LLC/LLC-SNAP)
|
|
|
*/
|
|
*/
|