• David Jander's avatar
    regmap: rbtree: Fix overlapping rbnodes. · 4e67fb5f
    David Jander authored
    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: default avatarDavid Jander <david@protonic.nl>
    Signed-off-by: default avatarMark Brown <broonie@linaro.org>
    Cc: stable@vger.kernel.org
    4e67fb5f
regcache-rbtree.c 11.3 KB