From: Kees Cook Date: Sat, 4 Mar 2017 01:45:38 +0000 (-0800) Subject: pstore: Avoid race in module unloading X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1344dd86f35c7669c94aceb2273676e356cff848;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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);