Commit 48b2e323 authored by Rohan G Thomas's avatar Rohan G Thomas Committed by Jakub Kicinski
Browse files

net: stmmac: est: Fix GCL bounds checks



Fix the bounds checks for the hw supported maximum GCL entry
count and gate interval time.

Fixes: b60189e0 ("net: stmmac: Integrate EST with TAPRIO scheduler API")
Signed-off-by: default avatarRohan G Thomas <rohan.g.thomas@altera.com>
Reviewed-by: default avatarMatthew Gerlach <matthew.gerlach@altera.com>
Link: https://patch.msgid.link/20251028-qbv-fixes-v4-3-26481c7634e3@altera.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ded9813d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -981,7 +981,7 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
	if (qopt->cmd == TAPRIO_CMD_DESTROY)
		goto disable;

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

		if (delta_ns > GENMASK(wid, 0))
		if (delta_ns > GENMASK(wid - 1, 0))
			return -ERANGE;
		if (gates > GENMASK(31 - wid, 0))
			return -ERANGE;