Skip to content

Commit cf89752

Browse files
geertuAl Viro
authored andcommitted
FS-Cache: Add missing initialization of ret in cachefiles_write_page()
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 <[email protected]> Signed-off-by: David Howells <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 8005c49 commit cf89752

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cachefiles/rdwr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
879879
loff_t pos, eof;
880880
size_t len;
881881
void *data;
882-
int ret;
882+
int ret = -ENOBUFS;
883883

884884
ASSERT(op != NULL);
885885
ASSERT(page != NULL);

0 commit comments

Comments
 (0)