summaryrefslogtreecommitdiffstats
path: root/fs/pstore
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-03-03 17:45:38 -0800
committerKees Cook <keescook@chromium.org>2017-03-07 08:21:38 -0800
commit1344dd86f35c7669c94aceb2273676e356cff848 (patch)
treef3d03fec8d2693cd9704514d645c81bde6db6312 /fs/pstore
parent6330d5534786d5315d56d558aa6d20740f97d80a (diff)
downloadlinux-1344dd86f35c7669c94aceb2273676e356cff848.tar.gz
linux-1344dd86f35c7669c94aceb2273676e356cff848.tar.bz2
linux-1344dd86f35c7669c94aceb2273676e356cff848.zip
pstore: Avoid race in module unloading
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>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/platform.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 074fe85a2078..d69ef8a840b9 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -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);