提交 a1db8060 编写于 作者: K Kees Cook

ramoops: Only unregister when registered

While none of the "fragile" pstore backends unregister yet, if they
ever did, the unregistering code for the non-dump targets might get
confused. This adds a check for fragile backends on unregister.
Signed-off-by: NKees Cook <keescook@chromium.org>
上级 1a695a90
......@@ -497,9 +497,11 @@ EXPORT_SYMBOL_GPL(pstore_register);
void pstore_unregister(struct pstore_info *psi)
{
pstore_unregister_pmsg();
pstore_unregister_ftrace();
pstore_unregister_console();
if ((psi->flags & PSTORE_FLAGS_FRAGILE) == 0) {
pstore_unregister_pmsg();
pstore_unregister_ftrace();
pstore_unregister_console();
}
pstore_unregister_kmsg();
free_buf_for_compression();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册