From b670b4b466f18bd0cf7afe690c3a5de150147f1c Mon Sep 17 00:00:00 2001 From: Ke Liu Date: Fri, 16 Dec 2022 09:29:56 +0800 Subject: [PATCH] hyperhold: Fix SIG_BUS error in hyperhold ohos inclusion category: Bugfix issue: #I66EP0 CVE: NA -------------------------------- Fix a SIG_BUS error in hyperhold. Signed-off-by: Ke Liu --- drivers/block/zram/zram_group/group_writeback.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/block/zram/zram_group/group_writeback.c b/drivers/block/zram/zram_group/group_writeback.c index 34f7ca616587..0956a2eb939a 100644 --- a/drivers/block/zram/zram_group/group_writeback.c +++ b/drivers/block/zram/zram_group/group_writeback.c @@ -410,6 +410,10 @@ static int read_one_obj_sync(struct zram *zram, u32 index) goto out; hyperhold_io_wait(hpio); + + /* if not reset to zero, will return err sometimes and cause SIG_BUS error */ + ret = 0; + /* get a write io, data is ready, copy the pages even write failed */ if (op_is_write(hyperhold_io_operate(hpio))) goto move; @@ -424,6 +428,7 @@ static int read_one_obj_sync(struct zram *zram, u32 index) zgrp_ext_delete(zram->zgrp, eid, gid); hyperhold_should_free_extent(eid); } + move_obj_from_hpio(zram, index, hpio); out: hyperhold_io_put(hpio); zram_slot_lock(zram, index); -- Gitee