summaryrefslogtreecommitdiff
path: root/fs/pstore
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2016-05-19 10:59:03 -0400
committerKees Cook <keescook@chromium.org>2016-05-31 12:36:44 -0700
commita1db8060f5c85e33ed810038036f409eed15decc (patch)
treedda9a1892fea7b307da9017f24cf6f2efe238af8 /fs/pstore
parent1a695a905c18548062509178b98bc91e67510864 (diff)
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: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/platform.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 588461bb2dd4..e8c17afdfb41 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -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();