diff options
author | Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com> | 2022-12-09 07:15:19 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-14 12:16:11 +0300 |
commit | 3f2a944c23e869017216355d01ea8940ac7dd4a2 (patch) | |
tree | ba7b671e0e6b23a8e8c5310bd6141cf9bdca8b66 /drivers/net | |
parent | a0e2295c2aed508365a2343dafe392fd0d3d57ae (diff) | |
download | linux-3f2a944c23e869017216355d01ea8940ac7dd4a2.tar.xz |
igc: Add checking for basetime less than zero
[ Upstream commit 3b61764fb49a6e147ac90d71dccdddc9d5508ba1 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/intel/igc/igc_main.c | 3 |
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 f4082ea7beaa..45069dc0ccc6 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -4912,6 +4912,9 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter, return 0; } + if (qopt->base_time < 0) + return -ERANGE; + if (adapter->base_time) return -EALREADY; |