Skip to content
Snippets Groups Projects
Commit f40ac2ae authored by Sunghan Suh's avatar Sunghan Suh Committed by Greg Kroah-Hartman
Browse files

zram: prevent data loss in error cases of function zram_bvec_write()


In function zram_bvec_write(), previous data at the index is
already freed by function zram_free_page().
When failed to compress or zs_malloc, there is no way to restore old data.
Therefore, free previous data when it's about to update.

Also, no need to check whether table is not empty outside of
function zram_free_page(), because the function properly checks inside.

Signed-off-by: default avatarSunghan Suh <sunghan.suh@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ca015835
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment