Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Geert Uytterhoeven and committed by
Linus Torvalds
f7c1d074 e686bd8d

+1 -1
+1 -1
mm/shmem.c
··· 1411 1411 pgoff_t index; 1412 1412 unsigned long offset; 1413 1413 enum sgp_type sgp = SGP_READ; 1414 - int error; 1414 + int error = 0; 1415 1415 ssize_t retval; 1416 1416 size_t count; 1417 1417 loff_t *ppos = &iocb->ki_pos;