regulator: core: return zero for selectors lower than linear_min_sel
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Wed, 25 Nov 2020 17:25:47 +0000 (19:25 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 26 Nov 2020 13:08:15 +0000 (13:08 +0000)
commit55cca73931c3a08eb74f5ad06e88304af7a292e0
tree51fc1fa1d293addeceef42688992f98f4ede7485
parent33f369efbce15e034db4faabeec8502d7d236859
regulator: core: return zero for selectors lower than linear_min_sel

Selectors lower than linear_min_sel should not be considered invalid.
Thus return zero in case _regulator_list_voltage(),
regulator_list_hardware_vsel() or regulator_list_voltage_table()
receives such selectors as argument.

Fixes: bdcd1177578c ("regulator: core: validate selector against linear_min_sel")
Reported-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/1606325147-606-1-git-send-email-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c
drivers/regulator/helpers.c