diff options
author | David Jander <david@protonic.nl> | 2013-08-21 17:37:22 +0200 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-21 17:03:54 +0100 |
commit | 4e67fb5f5e336250db944921e3c68057d6203034 (patch) | |
tree | 9942efc3da08fc11c28d887f191d7ee89ee4f96a /drivers/base | |
parent | b36f4be3de1b123d8601de062e7dbfc904f305fb (diff) | |
download | kernel_goldelico_gta04-4e67fb5f5e336250db944921e3c68057d6203034.zip kernel_goldelico_gta04-4e67fb5f5e336250db944921e3c68057d6203034.tar.gz kernel_goldelico_gta04-4e67fb5f5e336250db944921e3c68057d6203034.tar.bz2 |
regmap: rbtree: Fix overlapping rbnodes.
Avoid overlapping register regions by making the initial blklen of a new
node 1. If a register write occurs to a yet uncached register, that is
lower than but near an existing node's base_reg, a new node is created
and it's blklen is set to an arbitrary value (sizeof(*rbnode)). That may
cause this node to overlap with another node. Those nodes should be merged,
but this merge doesn't happen yet, so this patch at least makes the initial
blklen small enough to avoid hitting the wrong node, which may otherwise
lead to severe breakage.
Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/regmap/regcache-rbtree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c index 5c1435c..0fccc99 100644 --- a/drivers/base/regmap/regcache-rbtree.c +++ b/drivers/base/regmap/regcache-rbtree.c @@ -332,7 +332,7 @@ regcache_rbtree_node_alloc(struct regmap *map, unsigned int reg) } if (!rbnode->blklen) { - rbnode->blklen = sizeof(*rbnode); + rbnode->blklen = 1; rbnode->base_reg = reg; } |