Skip to content

Commit 3e61c4f

Browse files
qiwuchengregkh
authored andcommitted
pstore/platform: fix potential mem leak if pstore_init_fs failed
[ Upstream commit 8a57d6d ] There is a potential mem leak when pstore_init_fs failed, since the pstore compression maybe unlikey to initialized successfully. We must clean up the allocation once this unlikey issue happens. Signed-off-by: chenqiwu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 7371ef4 commit 3e61c4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/pstore/platform.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,9 +802,9 @@ static int __init pstore_init(void)
802802

803803
ret = pstore_init_fs();
804804
if (ret)
805-
return ret;
805+
free_buf_for_compression();
806806

807-
return 0;
807+
return ret;
808808
}
809809
late_initcall(pstore_init);
810810

0 commit comments

Comments
 (0)