提交 861d6660 编写于 作者: B Boaz Harrosh

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: NBoaz Harrosh <bharrosh@panasas.com>
上级 af402ab2
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册