From: Roland Dreier Date: Wed, 31 Oct 2012 16:16:45 +0000 (-0700) Subject: target: Avoid integer overflow in se_dev_align_max_sectors() X-Git-Tag: v3.2.34~34 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca8b38a5d0489f39245404acea9a1524b29d1cbb;p=pandora-kernel.git target: Avoid integer overflow in se_dev_align_max_sectors() commit 3e03989b5868acf69a391a424dc71fcd6cc48167 upstream. The expression (max_sectors * block_size) might overflow a u32 (indeed, since iblock sets max_hw_sectors to UINT_MAX, it is guaranteed to overflow and end up with a much-too-small result in many common cases). Fix this by doing an equivalent calculation that doesn't require multiplication. While we're touching this code, avoid splitting a printk format across two lines and use pr_info(...) instead of printk(KERN_INFO ...). Signed-off-by: Roland Dreier Signed-off-by: Nicholas Bellinger Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed