Skip to content

Commit

Permalink
exofs: don't leak io_state and pages on read error
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Boaz Harrosh committed Dec 14, 2012
1 parent af402ab commit 861d666
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fs/exofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 861d666

Please sign in to comment.