Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit f41be697 authored by Sunghan Suh's avatar Sunghan Suh Committed by Daniel Rosenberg
Browse files

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



(cherry pick from commit f40ac2ae1b506484dd9261a24bbf3e86b2206ff8)

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>
Bug: 24810447
Change-Id: Ib0361b2c60fd42ce8e03ee8b6ed5ab54b56a25c0
parent 0cdfb616
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment