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

Commit de4027c1 authored by Eric Biggers's avatar Eric Biggers Committed by Gerrit - the friendly Code Review server
Browse files

f2fs/fscrypt-ice: fix memory leak in read path



F2FS was leaking an fscrypt_ctx each time a bio is allocated to read
from an inode using inline encryption.

Tested: compiled (I don't have this device yet)
Bug: 68721442
Change-Id: I05685fb878525c26793d9c15641da9faa1015281
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
[stummala@codeaurora.org: Resolved merge conflicts]
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
parent 1158db35
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -565,7 +565,8 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr,
	bio->bi_end_io = f2fs_read_end_io;
	bio_set_op_attrs(bio, REQ_OP_READ, 0);

	if (f2fs_encrypted_file(inode))
        if (f2fs_encrypted_file(inode) &&
            !fscrypt_using_hardware_encryption(inode))
		post_read_steps |= 1 << STEP_DECRYPT;
	if (post_read_steps) {
		ctx = mempool_alloc(bio_post_read_ctx_pool, GFP_NOFS);