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:Sunghan Suh <sunghan.suh@samsung.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 24810447 Change-Id: Ib0361b2c60fd42ce8e03ee8b6ed5ab54b56a25c0
Loading
Please register or sign in to comment