driver/tcpm/anx7447: bound port argument

Found by Coverity Scan #187773, #204053

BUG=none
BRANCH=none
TEST=none

Change-Id: Ie7006828d8a5d760097baade6851c72d15e42cf1
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1801206
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
This commit is contained in:
Patrick Georgi 2019-09-12 15:02:47 +02:00 committed by Commit Bot
parent 3e7d997d68
commit f2086e771d
1 changed files with 4 additions and 0 deletions

View File

@ -285,6 +285,8 @@ static int anx7447_init(int port)
{
int rv, reg, i;
ASSERT(port < CONFIG_USB_PD_PORT_COUNT);
memset(&anx[port], 0, sizeof(struct anx_state));
/*
@ -491,6 +493,8 @@ void anx7447_tcpc_clear_hpd_status(int port)
#ifdef CONFIG_USB_PD_TCPM_MUX
static int anx7447_mux_init(int port)
{
ASSERT(port < CONFIG_USB_PD_PORT_COUNT);
memset(&mux[port], 0, sizeof(struct anx_usb_mux));
/* init hpd status */