]> git.baikalelectronics.ru Git - kernel.git/commit
pagemap.h: fix warning about possibly used before init var
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Tue, 29 May 2012 22:06:14 +0000 (15:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 May 2012 23:22:18 +0000 (16:22 -0700)
commit3b789ea8f6464f1f8fb8bac6f992ece65665ffed
treef1326d0a1873e03a36d6be6a53313331b64a0659
parent10aa54b1e0cad9df8e05b3f94d5ec88a565e8f57
pagemap.h: fix warning about possibly used before init var

Commit 242ffdc9f54a ("mm: extend prefault helpers to fault in more than
PAGE_SIZE") added in the new functions: fault_in_multipages_writeable()
and fault_in_multipages_readable().

However, we currently see:

  include/linux/pagemap.h:492: warning: 'ret' may be used uninitialized in this function
  include/linux/pagemap.h:492: note: 'ret' was declared here

Unlike a lot of gcc nags, this one appears somewhat legit.  i.e.  passing
in an invalid negative value of "size" does make it look like all the
conditionals in there would be bypassed and the uninitialized value would
be returned.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/pagemap.h