aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2014-04-13 14:46:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-13 17:10:26 -0400
commitf7c1d074200417d8204dd97b4acfdba1ebc63c89 (patch)
tree5e4dcd538837dcc4640a396262fd4fb6e1c577d0 /mm
parente686bd8dc55ebd605b792632c415481fbc952458 (diff)
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 6e58e79db8a1 ("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>
Diffstat (limited to 'mm')
-rw-r--r--mm/shmem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 8f1a95406bae..9f70e02111c6 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1411,7 +1411,7 @@ static ssize_t shmem_file_aio_read(struct kiocb *iocb,
1411 pgoff_t index; 1411 pgoff_t index;
1412 unsigned long offset; 1412 unsigned long offset;
1413 enum sgp_type sgp = SGP_READ; 1413 enum sgp_type sgp = SGP_READ;
1414 int error; 1414 int error = 0;
1415 ssize_t retval; 1415 ssize_t retval;
1416 size_t count; 1416 size_t count;
1417 loff_t *ppos = &iocb->ki_pos; 1417 loff_t *ppos = &iocb->ki_pos;