]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: aat2870: Fix the logic of checking if no id is matched in aat2870_get_regu...
authorAxel Lin <axel.lin@gmail.com>
Mon, 28 Nov 2011 06:06:31 +0000 (14:06 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 28 Nov 2011 11:48:15 +0000 (11:48 +0000)
commitf9b9bc42abe13b36c3bb915ea93fd8ecc23c3644
tree046e924ca1ea4c65aec700f7a42eb0477f3fb990
parent553ff3bd102159afa3b326ca269173aa80dfe107
regulator: aat2870: Fix the logic of checking if no id is matched in aat2870_get_regulator

In current implementation, the pointer ri is not NULL if no id is matched.
Fix it by checking i == ARRAY_SIZE(aat2870_regulators) if no id is matched.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
drivers/regulator/aat2870-regulator.c