From: Brian Norris Date: Wed, 21 May 2014 05:47:26 +0000 (-0700) Subject: mtd: nand: r852: correct write_buf loop bounds X-Git-Tag: omap-for-v3.16/fixes-against-rc1~57^2~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab7f6fcec33a01279d2abeaf1c4ccdfa8a5d93ff;p=pandora-kernel.git mtd: nand: r852: correct write_buf loop bounds The two loops in r852_write_buf() are designed to handle 4-byte-aligned and then 1-byte-aligned portions, respectively. However, there are two issues: (1) The first loop will only terminate if 'len' is a multiple of 4 (2) The second loop will never terminate if it runs at least once Rewrite these loops as they were probably intended. Compile tested only. Issues pointed out by Coverity Scan. Signed-off-by: Brian Norris Cc: Maxim Levitsky --- Reading git-diff-tree failed