Commit 8a57d6d4 authored by chenqiwu's avatar chenqiwu Committed by Kees Cook

pstore/platform: fix potential mem leak if pstore_init_fs failed

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: default avatarchenqiwu <chenqiwu@xiaomi.com>
Link: https://lore.kernel.org/r/1581068800-13817-1-git-send-email-qiwuchen55@gmail.comSigned-off-by: default avatarKees Cook <keescook@chromium.org>
parent 11a48a5a
......@@ -823,9 +823,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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment