Skip to content

Commit

Permalink
pstore: Avoid race in module unloading
Browse files Browse the repository at this point in the history
Technically, it might be possible for struct pstore_info to go out of
scope after the module_put(), so report the backend name first.

Signed-off-by: Kees Cook <keescook@chromium.org>
  • Loading branch information
Kees Cook committed Mar 7, 2017
1 parent 6330d55 commit 1344dd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/pstore/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,10 +722,10 @@ int pstore_register(struct pstore_info *psi)
*/
backend = psi->name;

module_put(owner);

pr_info("Registered %s as persistent store backend\n", psi->name);

module_put(owner);

return 0;
}
EXPORT_SYMBOL_GPL(pstore_register);
Expand Down

0 comments on commit 1344dd8

Please sign in to comment.