]> git.baikalelectronics.ru Git - kernel.git/commit
omfs: fix potential integer overflow in allocator
authorBob Copeland <me@bobcopeland.com>
Thu, 28 May 2015 22:44:37 +0000 (15:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 May 2015 01:25:19 +0000 (18:25 -0700)
commit0201b7f24b8afcff2d111ba70bf75dd40a2313b4
treef3878e295f5eaa25ecee2925481e4c0d9182f5a0
parentd878aab4feedf0bdda98ddeac347e5a124c3ce4d
omfs: fix potential integer overflow in allocator

Both 'i' and 'bits_per_entry' are signed integers but the result is a
u64 block number.  Cast i to u64 to avoid truncation on 32-bit targets.

Found by Coverity (CID 200679).

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/omfs/bitmap.c