regulator: pv88060: Fix array out-of-bounds access
authorAxel Lin <axel.lin@ingics.com>
Tue, 19 Feb 2019 10:00:00 +0000 (18:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:25 +0000 (14:50 +0100)
commit25920137367b37c2c3ae559c3d8ff959e4ac7482
tree233b96b8fcb92d44aad70d7d933a8a90415df00c
parentf27808ed8c147e178e77404eb7719ef3a96bf5e7
regulator: pv88060: Fix array out-of-bounds access

[ Upstream commit 7cd415f875591bc66c5ecb49bf84ef97e80d7b0e ]

Fix off-by-one while iterating current_limits array.
The valid index should be 0 ~ n_current_limits -1.

Fixes: f307a7e9b7af ("regulator: pv88060: new regulator driver")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/regulator/pv88060-regulator.c