summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMuhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>2022-12-09 05:15:19 +0100
committerTony Nguyen <anthony.l.nguyen@intel.com>2022-12-15 22:19:39 +0100
commit3b61764fb49a6e147ac90d71dccdddc9d5508ba1 (patch)
tree38fe5bfd0960eb7bcfeb133978cac642769b2a87 /drivers/net
parentigc: Use strict cycles for Qbv scheduling (diff)
downloadlinux-3b61764fb49a6e147ac90d71dccdddc9d5508ba1.tar.xz
linux-3b61764fb49a6e147ac90d71dccdddc9d5508ba1.zip
igc: Add checking for basetime less than zero
Using the tc qdisc command, the user can set basetime to any value. Checking should be done on the driver's side to prevent registering basetime values that are less than zero. Fixes: ec50a9d437f0 ("igc: Add support for taprio offloading") Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com> Tested-by: Naama Meir <naamax.meir@linux.intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/intel/igc/igc_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index c67a8e8ea972..6ed12329ae80 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -6047,6 +6047,9 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
if (!qopt->enable)
return igc_tsn_clear_schedule(adapter);
+ if (qopt->base_time < 0)
+ return -ERANGE;
+
if (adapter->base_time)
return -EALREADY;