]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
regulator: max8907: Fix the usage of uninitialized variable in max8907_regulator_probe()
authorYizhuo <yzhai003@ucr.edu>
Thu, 3 Oct 2019 17:58:13 +0000 (10:58 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 04:45:21 +0000 (23:45 -0500)
commitd0c7770ed88d5ae633ebac93e5988fa11f8aeb62
tree1f9a8640c590d83b1e43b4e3eceadeb71ef6ffb2
parent5f58300e8696df97f9c864123d11da144534d466
regulator: max8907: Fix the usage of uninitialized variable in max8907_regulator_probe()

BugLink: https://bugs.launchpad.net/bugs/1859712
[ Upstream commit 472b39c3d1bba0616eb0e9a8fa3ad0f56927c7d7 ]

Inside function max8907_regulator_probe(), variable val could
be uninitialized if regmap_read() fails. However, val is used
later in the if statement to decide the content written to
"pmic", which is potentially unsafe.

Signed-off-by: Yizhuo <yzhai003@ucr.edu>
Link: https://lore.kernel.org/r/20191003175813.16415-1-yzhai003@ucr.edu
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/max8907-regulator.c