diff options
author | Wai-Hong Tam <waihong@google.com> | 2018-08-03 14:23:32 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-08-03 22:14:40 -0700 |
commit | 3a0ae0eb46610e6f99e7c99114ae12621c3dab2a (patch) | |
tree | 2e63a7d30d85e3976cc4e564f71cb29f8cf35bd2 /board/rainier/board.h | |
parent | 40906ac081d894eb160164c87366b3f3de974d01 (diff) | |
download | chrome-ec-3a0ae0eb46610e6f99e7c99114ae12621c3dab2a.tar.gz |
board: Fix ADC_VBUS -1 accessing array out-of-bounds
Some boards still define ADC_VBUS -1. It seems to be an old convention
for the case no vbus adc channel, before the change:
https://chromium-review.googlesource.com/charge_manager.c
It causes reading the adc channel -1 if
CONFIG_USB_PD_VBUS_MEASURE_NOT_PRESENT not defined. This is an
out-of-bounds array access and sometime it causes a "Divide by 0"
exception.
BRANCH=none
BUG=b:112204765
TEST=make buildall -j
TEST=Booted cheza and didn't see "Divide by 0" exception.
Change-Id: Ic44c3e89023f580d499ed52dc38bef0a3a12a0cf
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1162883
Reviewed-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Diffstat (limited to 'board/rainier/board.h')
-rw-r--r-- | board/rainier/board.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/board/rainier/board.h b/board/rainier/board.h index b9b41c0a00..7e3dc17330 100644 --- a/board/rainier/board.h +++ b/board/rainier/board.h @@ -92,7 +92,7 @@ #define CONFIG_USB_PD_PORT_COUNT 1 #define CONFIG_USB_PD_TCPM_FUSB302 #define CONFIG_USB_PD_VBUS_DETECT_TCPC -#define ADC_VBUS -1 +#define CONFIG_USB_PD_VBUS_MEASURE_NOT_PRESENT #define CONFIG_USBC_SS_MUX #define CONFIG_USBC_VCONN #define CONFIG_USBC_VCONN_SWAP |