]> git.baikalelectronics.ru Git - 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)
committerMark Brown <broonie@kernel.org>
Fri, 4 Oct 2019 17:45:43 +0000 (18:45 +0100)
commit34f2c2378dd97ab5add9dd4e10ab7cd388c07a9d
treee144268c2dd33bbb0b783e27f9ca46b1aac03916
parente468bb4bd09860ae5a20a54bd95cfdfae298fb92
regulator: max8907: Fix the usage of uninitialized variable in max8907_regulator_probe()

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>
drivers/regulator/max8907-regulator.c