linux/drivers/base/regmap
Guenter Roeck c177f283b7 regmap: regcache-rbtree: Clean new present bits on present bitmap resize
commit 8ef9724bf9 upstream.

When inserting a new register into a block, the present bit map size is
increased using krealloc. krealloc does not clear the additionally
allocated memory, leaving it filled with random values. Result is that
some registers are considered cached even though this is not the case.

Fix the problem by clearing the additionally allocated memory. Also, if
the bitmap size does not increase, do not reallocate the bitmap at all
to reduce overhead.

Fixes: 3f4ff561bc ("regmap: rbtree: Make cache_present bitmap per node")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2015-08-31 14:14:07 +01:00
..
internal.h regmap: introduce regmap_name to fix syscon regmap trace events 2015-04-10 10:03:57 +01:00
Kconfig regmap: add SPMI support 2013-10-28 12:51:43 -07:00
Makefile regmap: add SPMI support 2013-10-28 12:51:43 -07:00
regcache-flat.c regmap: flat: Add flat cache type 2013-01-02 10:58:53 +00:00
regcache-lzo.c regmap: cache: Pass the map rather than the word size when updating values 2013-03-04 10:30:27 +08:00
regcache-rbtree.c regmap: regcache-rbtree: Clean new present bits on present bitmap resize 2015-08-31 14:14:07 +01:00
regcache.c regmap: introduce regmap_name to fix syscon regmap trace events 2015-04-10 10:03:57 +01:00
regmap-debugfs.c regmap: debugfs: fix possbile NULL pointer dereference 2014-10-30 09:40:11 -07:00
regmap-i2c.c regmap: i2c: fallback to SMBus if the adapter does not support standard I2C 2014-04-22 12:57:28 +01:00
regmap-irq.c regmap: irq: Fix possible ZERO_SIZE_PTR pointer dereferencing error. 2014-05-26 16:37:04 +01:00
regmap-mmio.c Merge remote-tracking branches 'regmap/topic/irq', 'regmap/topic/le', 'regmap/topic/mmio' and 'regmap/topic/rbtree' into regmap-next 2014-06-02 17:07:39 +01:00
regmap-spi.c drivers/base: delete non-required instances of include <linux/init.h> 2014-02-14 14:31:37 -08:00
regmap-spmi.c regmap: spmi: support base and extended register spaces 2014-02-15 11:55:28 -08:00
regmap.c regmap: Fix possible shift overflow in regmap_field_init() 2015-07-15 10:00:37 +01:00