summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRobert Zieba <robertzieba@google.com>2022-08-18 13:56:10 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-18 23:07:36 +0000
commit084bd413512bb19fd24f6f2a05ebc4e42fd64fe0 (patch)
treef5a0da76ec751c5afc9a20caa2fe011c96babfa5 /common
parentc03fab67e2a358808e76f0c690cdb2e99021833f (diff)
downloadchrome-ec-084bd413512bb19fd24f6f2a05ebc4e42fd64fe0.tar.gz
common/timer: Make passing negative values to `waitms` an error
This commit updates the `waitms` command so that passing a negative value will result in an error. BRANCH=none BUG=b:236074108 TEST=Built, ran subsequent zephyr test Change-Id: Ib1e9a05a5dc865b2bce71a2449016aa6863b289c Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3840650 Reviewed-by: Tristan Honscheid <honscheid@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Tristan Honscheid <honscheid@google.com>
Diffstat (limited to 'common')
-rw-r--r--common/timer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/timer.c b/common/timer.c
index ccf77eb9be..700eb9b509 100644
--- a/common/timer.c
+++ b/common/timer.c
@@ -365,6 +365,9 @@ static int command_wait(int argc, char **argv)
if (*e)
return EC_ERROR_PARAM1;
+ if (i < 0)
+ return EC_ERROR_PARAM1;
+
/*
* Reload the watchdog so that issuing multiple small waitms commands
* quickly one after the other will not cause a reset.