]> git.baikalelectronics.ru Git - kernel.git/commit
regmap: rbtree: Fix overlapping rbnodes.
authorDavid Jander <david@protonic.nl>
Wed, 21 Aug 2013 15:37:22 +0000 (17:37 +0200)
committerMark Brown <broonie@linaro.org>
Wed, 21 Aug 2013 16:03:54 +0000 (17:03 +0100)
commit22058a599549bde1c120009871ddcdb4be988066
tree9942efc3da08fc11c28d887f191d7ee89ee4f96a
parent7389eb40d97a7be49653b327fc3faf73333a31e2
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
drivers/base/regmap/regcache-rbtree.c