regcache: flat: Require max_registers to be set
authorAlexander Stein <alexander.stein@systec-electronic.com>
Tue, 29 Mar 2016 06:53:32 +0000 (08:53 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 29 Mar 2016 16:51:04 +0000 (09:51 -0700)
commit6e4f28780f38e27cb7ca0edeb1d7ebb4edfd1fc5
tree781ef0c6f3796dd94b56009cb09cbd8f669fc0ee
parentf55532a0c0b8bb6148f4e07853b876ef73bc69ca
regcache: flat: Require max_registers to be set

If max_register is unset, regcache_flat_get_index will return 0 and only
memory for 1 unsigned int will be allocated, resulting in writing out
of bounds.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regcache-flat.c