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

Unverified Commit c79f4e10 authored by Nathan Chancellor's avatar Nathan Chancellor
Browse files

Revert "ANDROID: Revert "f2fs: avoid out-of-range memory access""



This reverts commit 0aed061b.

This should not have been reverted in this branch as it was already here
as part of the f2fs-stable merge that was done in commit 8ed00839
("Merge remote-tracking branch 'origin/upstream-f2fs-stable-linux-4.9.y'
into android-4.9") already contained it and everything built fine.

The build error in android-4.9-p occurs due to the presence of commit
c804fcf3 ("f2fs: no need return value in restore summary process")
and lack of commit 3c74326b ("f2fs: fix to propagate error from
__get_meta_page()") in that branch.

Change-Id: I0738d38a0feca9dfd1115871ecd33ee93442d76b
Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
parent 2c9cf637
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3444,6 +3444,11 @@ static int read_compacted_summaries(struct f2fs_sb_info *sbi)
		seg_i = CURSEG_I(sbi, i);
		segno = le32_to_cpu(ckpt->cur_data_segno[i]);
		blk_off = le16_to_cpu(ckpt->cur_data_blkoff[i]);
		if (blk_off > ENTRIES_IN_SUM) {
			f2fs_bug_on(sbi, 1);
			f2fs_put_page(page, 1);
			return -EFAULT;
		}
		seg_i->next_segno = segno;
		reset_curseg(sbi, i, 0);
		seg_i->alloc_type = ckpt->alloc_type[i];