Skip to content

Commit

Permalink
ramoops: Only unregister when registered
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
kees committed May 31, 2016
1 parent 1a695a9 commit a1db806
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fs/pstore/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a1db806

Please sign in to comment.