mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
pstore/platform: fix potential mem leak if pstore_init_fs failed
[ Upstream commit 8a57d6d4dd
]
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 <chenqiwu@xiaomi.com>
Link: https://lore.kernel.org/r/1581068800-13817-1-git-send-email-qiwuchen55@gmail.com
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7371ef43c7
commit
3e61c4fab1
1 changed files with 2 additions and 2 deletions
|
@ -802,9 +802,9 @@ static int __init pstore_init(void)
|
|||
|
||||
ret = pstore_init_fs();
|
||||
if (ret)
|
||||
return ret;
|
||||
free_buf_for_compression();
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
late_initcall(pstore_init);
|
||||
|
||||
|
|
Loading…
Reference in a new issue