regmap: debugfs: Avoid overflows for very small reads
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 10 Dec 2012 16:14:11 +0000 (01:14 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 10 Dec 2012 16:29:39 +0000 (01:29 +0900)
commitdb04328c167ff8e7c57f4a3532214aeada3a82fd
treea1c57616c3007b6d4fbb29a28f144ec89302917e
parentcbc1938badc31f43ab77e92a9b1a51c4fe8b4113
regmap: debugfs: Avoid overflows for very small reads

If count is less than the size of a register then we may hit integer
wraparound when trying to move backwards to check if we're still in
the buffer. Instead move the position forwards to check if it's still
in the buffer, we are unlikely to be able to allocate a buffer
sufficiently big to overflow here.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
drivers/base/regmap/regmap-debugfs.c