Commit 49203a28 authored by Sandeep Dhavale's avatar Sandeep Dhavale Committed by Matthias Männich
Browse files

FROMGIT: erofs: fix possible memory leak in z_erofs_gbuf_exit()



Because we incorrectly reused of variable `i` in `z_erofs_gbuf_exit()`
for inner loop, we may exit early from outer loop resulting in memory
leak. Fix this by using separate variable for iterating through inner loop.

Bug: 348591003
Change-Id: I70b4301a80b5282d1167e09de866c3764fd0f8d4
Fixes: f36f3010 ("erofs: rename per-CPU buffers to global buffer pool and make it configurable")
Signed-off-by: default avatarSandeep Dhavale <dhavale@google.com>
Reviewed-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20240624220206.3373197-1-dhavale@google.com


Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
(cherry picked from commit e41f107428237224fd51d99a4dc4358aba3b7d5f
 https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git

 dev-test)
Signed-off-by: default avatarChunhai Guo <guochunhai@vivo.com>
parent 0013c554
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment