Files
OpenCellular/chip
Martin Roth 681284ca22 npcx/i2c.c: Verify that controller value is not negative before using it
The function i2c_port_to_controller() returns a negative value if
the port value was out of range.  This wasn't being checked before the
controller value was getting used which could lead to using an invalid
value as a pointer to a structure.

This returns an error where it makes sense, and just ignores the
incorrect value otherwise.

TEST=Build
BUG=None
BRANCH=None

Change-Id: Ie8967bc4db87d3dd1863a2e36e35ac87e6161132
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/371400
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Mulin Chao <mlchao@nuvoton.com>
2016-08-23 15:37:13 -07:00
..
2016-08-23 15:36:59 -07:00
2016-05-26 16:17:26 -07:00
2016-08-21 04:11:10 -07:00