]> git.baikalelectronics.ru Git - kernel.git/commit
mm: Initialize error in shmem_file_aio_read()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Sun, 13 Apr 2014 18:46:22 +0000 (20:46 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 13 Apr 2014 21:10:26 +0000 (14:10 -0700)
commit3ca7289ae0434e781164e0ca3c722ef4a01868ab
tree5e4dcd538837dcc4640a396262fd4fb6e1c577d0
parent50cda7699d0766827367eaa28722cda6031092fd
mm: Initialize error in shmem_file_aio_read()

Some versions of gcc even warn about it:

  mm/shmem.c: In function ‘shmem_file_aio_read’:
  mm/shmem.c:1414: warning: ‘error’ may be used uninitialized in this function

If the loop is aborted during the first iteration by one of the two
first break statements, error will be uninitialized.

Introduced by commit 0bf40b5ab50a ("introduce copy_page_to_iter, kill
loop over iovec in generic_file_aio_read()").

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/shmem.c