Skip to content

Commit 48b2e32

Browse files
rohangt07kuba-moo
authored andcommitted
net: stmmac: est: Fix GCL bounds checks
Fix the bounds checks for the hw supported maximum GCL entry count and gate interval time. Fixes: b60189e ("net: stmmac: Integrate EST with TAPRIO scheduler API") Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com> Reviewed-by: Matthew Gerlach <matthew.gerlach@altera.com> Link: https://patch.msgid.link/20251028-qbv-fixes-v4-3-26481c7634e3@altera.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent ded9813 commit 48b2e32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
981981
if (qopt->cmd == TAPRIO_CMD_DESTROY)
982982
goto disable;
983983

984-
if (qopt->num_entries >= dep)
984+
if (qopt->num_entries > dep)
985985
return -EINVAL;
986986
if (!qopt->cycle_time)
987987
return -ERANGE;
@@ -1012,7 +1012,7 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
10121012
s64 delta_ns = qopt->entries[i].interval;
10131013
u32 gates = qopt->entries[i].gate_mask;
10141014

1015-
if (delta_ns > GENMASK(wid, 0))
1015+
if (delta_ns > GENMASK(wid - 1, 0))
10161016
return -ERANGE;
10171017
if (gates > GENMASK(31 - wid, 0))
10181018
return -ERANGE;

0 commit comments

Comments
 (0)