kernel: add at803x fix for sgmii mode
[lede.git] / target / linux / generic / patches-3.18 / 077-08-bgmac-add-check-for-oversized-packets.patch
index 89e1a3236885cac4da6aeb4cfe0fe3e22fe758ac..705aa2d2a4d8201c61317cfcfa9d3107aa19f640 100644 (file)
@@ -11,14 +11,14 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
 
 --- a/drivers/net/ethernet/broadcom/bgmac.c
 +++ b/drivers/net/ethernet/broadcom/bgmac.c
-@@ -428,6 +428,13 @@ static int bgmac_dma_rx_read(struct bgma
+@@ -445,6 +445,13 @@ static int bgmac_dma_rx_read(struct bgma
                                break;
                        }
  
 +                      if (len > BGMAC_RX_ALLOC_SIZE) {
 +                              bgmac_err(bgmac, "Found oversized packet at slot %d, DMA issue!\n",
 +                                        ring->start);
-+                              kfree(buf);
++                              put_page(virt_to_head_page(buf));
 +                              break;
 +                      }
 +