Skip to content

Commit f7c1d07

Browse files
geertutorvalds
authored andcommitted
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 6e58e79 ("introduce copy_page_to_iter, kill loop over iovec in generic_file_aio_read()"). Signed-off-by: Geert Uytterhoeven <[email protected]> Acked-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e686bd8 commit f7c1d07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/shmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ static ssize_t shmem_file_aio_read(struct kiocb *iocb,
14111411
pgoff_t index;
14121412
unsigned long offset;
14131413
enum sgp_type sgp = SGP_READ;
1414-
int error;
1414+
int error = 0;
14151415
ssize_t retval;
14161416
size_t count;
14171417
loff_t *ppos = &iocb->ki_pos;

0 commit comments

Comments
 (0)