summaryrefslogtreecommitdiff
path: root/drivers/staging/zram
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-06-06 20:07:25 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-06 23:12:20 +0400
commit65c484609a3b25c35e4edcd5f2c38f98f5226093 (patch)
treee9664426eb8d9f17c01f8b79c26a2c655acd85a1 /drivers/staging/zram
parent39a9b8ac9333e4268ecff7da6c9d1ab3823ff243 (diff)
downloadlinux-65c484609a3b25c35e4edcd5f2c38f98f5226093.tar.xz
zram: avoid double free in function zram_bvec_write()
When doing a patial write and the whole page is filled with zero, zram_bvec_write() will free uncmem twice. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Acked-by: Minchan Kim <minchan@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/zram')
-rw-r--r--drivers/staging/zram/zram_drv.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index 3335a6ce1784..f7603617db75 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -272,8 +272,6 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
if (page_zero_filled(uncmem)) {
kunmap_atomic(user_mem);
- if (is_partial_io(bvec))
- kfree(uncmem);
zram->stats.pages_zero++;
zram_set_flag(meta, index, ZRAM_ZERO);
ret = 0;