]> git.hungrycats.org Git - linux/commit
regmap: prevent division by zero in rbtree_show
authorStephen Warren <swarren@nvidia.com>
Wed, 4 Apr 2012 21:48:33 +0000 (15:48 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2012 16:13:55 +0000 (09:13 -0700)
commit7c31d609fd06b5cf3353aacd2c394b06a06e757a
treeceb786379c38b3ed42686d78e71770d09449dd8a
parent9aa06b85e000ef2fcba2b8dfa3e57eb809e99026
regmap: prevent division by zero in rbtree_show

commit c04c1b9ee8f30c7a3a25e20e406247003f634ebe upstream.

If there are no nodes in the cache, nodes will be 0, so calculating
"registers / nodes" will cause division by zero.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/regmap/regcache-rbtree.c