Commit 5f341b0a authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Greg Kroah-Hartman

FS-Cache: Add missing initialization of ret in cachefiles_write_page()

commit cf897526 upstream.

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: 102f4d90 ("FS-Cache: Handle a write to the page immediately beyond the EOF marker")
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0b8c6bb1
...@@ -885,7 +885,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page) ...@@ -885,7 +885,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
loff_t pos, eof; loff_t pos, eof;
size_t len; size_t len;
void *data; void *data;
int ret; int ret = -ENOBUFS;
ASSERT(op != NULL); ASSERT(op != NULL);
ASSERT(page != NULL); ASSERT(page != NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment