]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commitd5a7487b5a14c8010a3e13f545eeb66660adf7cb
tree9c0ded071f75a808b1ad2cbb96875ab9c81014b4
parentdb64c45a0d3460bdd8ebd41c3522f61e2aef9936
regulator: pv88060: Fix array out-of-bounds access

BugLink: https://bugs.launchpad.net/bugs/1863019
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/regulator/pv88060-regulator.c