diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2012-11-30 15:03:31 +0100 |
---|---|---|
committer | Boaz Harrosh <bharrosh@panasas.com> | 2012-12-14 11:17:32 +0100 |
commit | 861d66601acda6d7a2038fb3c95f68009128003a (patch) | |
tree | 5d0c9ede684df2d9788bde18129354fe4736bcad /fs | |
parent | exofs: clean up the correct page collection on write error (diff) | |
download | linux-861d66601acda6d7a2038fb3c95f68009128003a.tar.xz linux-861d66601acda6d7a2038fb3c95f68009128003a.zip |
exofs: don't leak io_state and pages on read error
Same bug as fixed by Idan for write_exec was in read_exec.
Fix the io_state leak and pages state on read error.
Also while at it:
The if (!pcol->read_4_write) at the error path is redundant
because all goto err; are after the if (pcol->read_4_write)
bale out.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/exofs/inode.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c index 1634b946565f..d1f80abd8828 100644 --- a/fs/exofs/inode.c +++ b/fs/exofs/inode.c @@ -361,12 +361,12 @@ static int read_exec(struct page_collect *pcol) return 0; err: - if (!pcol->read_4_write) - _unlock_pcol_pages(pcol, ret, READ); - - pcol_free(pcol); - + if (!pcol_copy) /* Failed before ownership transfer */ + pcol_copy = pcol; + _unlock_pcol_pages(pcol_copy, ret, READ); + pcol_free(pcol_copy); kfree(pcol_copy); + return ret; } |