aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm4908/patches-5.4/073-v5.12-0010-net-broadcom-bcm4908_enet-fix-RX-path-possible-mem-l.patch
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2021-03-01 08:14:49 +0100
committerRafał Miłecki <rafal@milecki.pl>2021-03-17 21:22:29 +0100
commit67df3a829b33dfaa8068209d31246296985e9888 (patch)
tree9a1ae478d20edc14c3d8dcf9cbe5f5c501be2a3b /target/linux/bcm4908/patches-5.4/073-v5.12-0010-net-broadcom-bcm4908_enet-fix-RX-path-possible-mem-l.patch
parent08bbe361e02043ef85ed42d294f93f7e6d962d45 (diff)
downloadupstream-67df3a829b33dfaa8068209d31246296985e9888.tar.gz
upstream-67df3a829b33dfaa8068209d31246296985e9888.tar.bz2
upstream-67df3a829b33dfaa8068209d31246296985e9888.zip
bcm4908: backport Ethernet driver fixes from the 5.12
The most noticeable one is fix for RX stopping on high traffic. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit acbea54bc29a22d8fb171bc9da0f1b16fb0ec233)
Diffstat (limited to 'target/linux/bcm4908/patches-5.4/073-v5.12-0010-net-broadcom-bcm4908_enet-fix-RX-path-possible-mem-l.patch')
-rw-r--r--target/linux/bcm4908/patches-5.4/073-v5.12-0010-net-broadcom-bcm4908_enet-fix-RX-path-possible-mem-l.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/target/linux/bcm4908/patches-5.4/073-v5.12-0010-net-broadcom-bcm4908_enet-fix-RX-path-possible-mem-l.patch b/target/linux/bcm4908/patches-5.4/073-v5.12-0010-net-broadcom-bcm4908_enet-fix-RX-path-possible-mem-l.patch
new file mode 100644
index 0000000000..8a24324122
--- /dev/null
+++ b/target/linux/bcm4908/patches-5.4/073-v5.12-0010-net-broadcom-bcm4908_enet-fix-RX-path-possible-mem-l.patch
@@ -0,0 +1,30 @@
+From 4dc7f09b8becfa35a55430a49d95acf19f996e6b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Wed, 24 Feb 2021 16:18:41 +0100
+Subject: [PATCH] net: broadcom: bcm4908_enet: fix RX path possible mem leak
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+After filling RX ring slot with new skb it's required to free old skb.
+Immediately on error or later in the net subsystem.
+
+Fixes: 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controller driver")
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+Acked-by: Florian Fainelli <f.fainelli@gmail.com>
+Link: https://lore.kernel.org/r/20210224151842.2419-1-zajec5@gmail.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ drivers/net/ethernet/broadcom/bcm4908_enet.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
++++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
+@@ -570,6 +570,7 @@ static int bcm4908_enet_poll(struct napi
+
+ if (len < ETH_ZLEN ||
+ (ctl & (DMA_CTL_STATUS_SOP | DMA_CTL_STATUS_EOP)) != (DMA_CTL_STATUS_SOP | DMA_CTL_STATUS_EOP)) {
++ kfree_skb(slot.skb);
+ enet->netdev->stats.rx_dropped++;
+ break;
+ }