From: Mark Brown Date: Mon, 10 Dec 2012 16:14:11 +0000 (+0900) Subject: regmap: debugfs: Avoid overflows for very small reads X-Git-Tag: v3.2.36~60 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71f1e737a5ab8cc3c1384117222ef82c99bc056d;p=pandora-kernel.git regmap: debugfs: Avoid overflows for very small reads commit db04328c167ff8e7c57f4a3532214aeada3a82fd upstream. 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 [bwh: Backported to 3.2: formatted length is tot_len] Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed