Skip to content

Commit

Permalink
FS-Cache: Add missing initialization of ret in cachefiles_write_page()
Browse files Browse the repository at this point in the history
fs/cachefiles/rdwr.c: In function ‘cachefiles_write_page’:
fs/cachefiles/rdwr.c:882: warning: ‘ret’ may be used uninitialized in
this function

If the jump to label "error" is taken, "ret" will indeed be
uninitialized, and random stack data may be printed by the debug code.

Fixes: 102f4d9 ("FS-Cache: Handle a write to the page immediately beyond the EOF marker")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Geert Uytterhoeven authored and Al Viro committed Nov 17, 2015
1 parent 8005c49 commit cf89752
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/cachefiles/rdwr.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
loff_t pos, eof;
size_t len;
void *data;
int ret;
int ret = -ENOBUFS;

ASSERT(op != NULL);
ASSERT(page != NULL);
Expand Down

0 comments on commit cf89752

Please sign in to comment.