Skip to contentSkip to conversation

taprio: fix wrong for loop condition in add_tc_entries()

PATCH Applied Tan Tee Min 3 participants 3 messages Dec 2, 2022 – Dec 5, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 taprio: fix wrong for loop condition in add_tc_entries()

The for loop in add_tc_entries() mistakenly included the last entry index+1. Fix it to correctly loop the max_sdu entry between tc=0 and num_max_sdu_entries-1.

Fixes b10a6509c195 ("taprio: support dumping and setting per-tc max SDU")
---
 tc/q_taprio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tc/q_taprio.c +1 -1
index ded385ca..a7c01ae0 100644
@@ -157,7 +157,7 @@ static void add_tc_entries(struct nlmsghdr *n, __u32 max_sdu[TC_QOPT_MAX_QUEUE],
 	struct rtattr *l;
 	__u32 tc;
 
-	for (tc = 0; tc <= num_max_sdu_entries; tc++) {
+	for (tc = 0; tc < num_max_sdu_entries; tc++) {
 		l = addattr_nest(n, 1024, TCA_TAPRIO_ATTR_TC_ENTRY | NLA_F_NESTED);
 
 		addattr_l(n, 1024, TCA_TAPRIO_TC_ENTRY_INDEX, &tc, sizeof(tc));
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Quoted 8 lines · On Fri, 2 Dec 2022 14:25:42 +0800 you wrote:

The for loop in add_tc_entries() mistakenly included the last entry index+1. Fix it to correctly loop the max_sdu entry between tc=0 and num_max_sdu_entries-1.

Fixes b10a6509c195 ("taprio: support dumping and setting per-tc max SDU")

[...]

Here is the summary with links:
- [iproute2-next,1/1] taprio: fix wrong for loop condition in add_tc_entries()

    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=43aa9d9ce7f8

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html