diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2019-01-16 08:44:24 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-01-17 12:18:20 -0800 |
commit | 66d7782a7b20fd974b18baeefb5e79feae80fb40 (patch) | |
tree | d6ea4842e0962d38442926fd7b07a270e03356d1 | |
parent | a60d1597d9f9ececf9940c20318d1876348d8f1e (diff) | |
download | chrome-ec-66d7782a7b20fd974b18baeefb5e79feae80fb40.tar.gz |
ectool: Check address of comm_init_lpc/_i2c before calling them
This patch makes ectool check the address of comm_init_lpc and
comm_init_i2c before calling them.
Related bug:b/35571850
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b/122478187
BRANCH=none
TEST=buildall
Change-Id: I32499174d7f82e45941cd97cf7780ea04517115f
Reviewed-on: https://chromium-review.googlesource.com/1414706
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@google.com>
-rw-r--r-- | util/comm-host.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/util/comm-host.c b/util/comm-host.c index f8be25294c..e020cf8840 100644 --- a/util/comm-host.c +++ b/util/comm-host.c @@ -95,11 +95,13 @@ int comm_init_alt(int interfaces, const char *device_name) * cros_ec device */ if (!strcmp(CROS_EC_DEV_NAME, device_name)) { /* Fallback to direct LPC on x86 */ - if ((interfaces & COMM_LPC) && !comm_init_lpc()) + if ((interfaces & COMM_LPC) && + comm_init_lpc && !comm_init_lpc()) return 0; /* Fallback to direct i2c on ARM */ - if ((interfaces & COMM_I2C) && !comm_init_i2c()) + if ((interfaces & COMM_I2C) && + comm_init_i2c && !comm_init_i2c()) return 0; } |