Skip to content

Commit

Permalink
net: stmmac: Add check for taprio basetime configuration
Browse files Browse the repository at this point in the history
Adds a boundary check to prevent negative basetime input from user
while configuring taprio.

Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>
Signed-off-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael Sit Wei Hong authored and David S. Miller committed Dec 12, 2022
1 parent 93c60b5 commit 6d534ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,9 @@ static int tc_setup_taprio(struct stmmac_priv *priv,
int i, ret = 0;
u64 ctr;

if (qopt->base_time < 0)
return -ERANGE;

if (!priv->dma_cap.estsel)
return -EOPNOTSUPP;

Expand Down

0 comments on commit 6d534ee

Please sign in to comment.