Commit 7dd294f7 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] uninitialised local in generic_file_write

generic_file_write_nolock() is initialising the pagevec too late,
so if we take an early `goto out' the kernel oopses.  O_DIRECT writes
take that path.
parent 75754eb4
...@@ -1866,6 +1866,8 @@ ssize_t generic_file_write_nolock(struct file *file, const char *buf, ...@@ -1866,6 +1866,8 @@ ssize_t generic_file_write_nolock(struct file *file, const char *buf,
if (unlikely(pos < 0)) if (unlikely(pos < 0))
return -EINVAL; return -EINVAL;
pagevec_init(&lru_pvec);
if (unlikely(file->f_error)) { if (unlikely(file->f_error)) {
err = file->f_error; err = file->f_error;
file->f_error = 0; file->f_error = 0;
...@@ -1976,7 +1978,6 @@ ssize_t generic_file_write_nolock(struct file *file, const char *buf, ...@@ -1976,7 +1978,6 @@ ssize_t generic_file_write_nolock(struct file *file, const char *buf,
goto out_status; goto out_status;
} }
pagevec_init(&lru_pvec);
do { do {
unsigned long index; unsigned long index;
unsigned long offset; unsigned long offset;
......
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