[openwrt/openwrt] kernel: fix kernel panic in mtk_ppe

LEDE Commits lede-commits at lists.infradead.org
Mon Jan 16 14:05:50 PST 2023


dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/83c0942ff7cb1a1aae2e5da6424c803644e3fa38

commit 83c0942ff7cb1a1aae2e5da6424c803644e3fa38
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Mon Jan 16 19:40:24 2023 +0000

    kernel: fix kernel panic in mtk_ppe
    
    The patch that adds support for hw flow-offloading counters on newer
    MediaTek SoCs tries to prints acct->packets and acct->bytes in debugfs,
    without checking that acct isn't null. This causes a kernel panic when
    trying to read /sys/kernel/debug/ppe0/entries on older MediaTek SoCs.
    Fix this by adding a check for acct.
    
    Fixes: openwrt#11756
    Fixes: 9721a42a27 ("kernel: support hw flow-offloading counters on newer MediaTek SoCs")
    Reported-by: Stijn Tintel <stijn at linux-ipv6.be>
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 .../731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch b/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch
index aea6a605a9..c76a00eabd 100644
--- a/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch
+++ b/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch
@@ -357,7 +357,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  			   h_source, h_dest, ntohs(l2->etype),
 -			   l2->vlan1, l2->vlan2, entry->ib1, ib2);
 +			   l2->vlan1, l2->vlan2, entry->ib1, ib2,
-+			   acct->packets, acct->bytes);
++			   acct ? acct->packets : 0, acct ? acct->bytes : 0);
  	}
  
  	return 0;




More information about the lede-commits mailing list