From 79cbf4df7fc9dbe80a4b88f93e83dcc323e3ed70 Mon Sep 17 00:00:00 2001 From: Jacob Garber Date: Fri, 24 May 2019 17:34:23 -0600 Subject: common: Remove duplicate error check This argument count check is already performed at the beginning of the function and is useless anyway since we've already accessed argv[1]. BUG=none BRANCH=none TEST=none Change-Id: I9f1de3c5e67bb0db5564d8a1161b2ae646e8dfe9 Signed-off-by: Jacob Garber Found-by: Coverity CID 141743 Reviewed-on: https://chromium-review.googlesource.com/1629277 Legacy-Commit-Queue: Commit Bot Reviewed-by: Daisuke Nojiri --- common/usb_pd_protocol.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 04b3b5223b..74666fef98 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -4852,9 +4852,7 @@ static int command_pd(int argc, char **argv) else if (!strncasecmp(argv[1], "trysrc", 6)) { int enable; - if (argc < 2) { - return EC_ERROR_PARAM_COUNT; - } else if (argc >= 3) { + if (argc >= 3) { enable = strtoi(argv[2], &e, 10); if (*e) return EC_ERROR_PARAM3; -- cgit v1.2.1