summaryrefslogtreecommitdiffstats
path: root/fs/pstore
diff options
context:
space:
mode:
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/platform.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 8beaeff72386..715396bef0ea 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -624,7 +624,7 @@ int pstore_register(struct pstore_info *psi)
* Update the module parameter backend, so it is visible
* through /sys/module/pstore/parameters/backend
*/
- backend = psi->name;
+ backend = kstrdup(psi->name, GFP_KERNEL);
pr_info("Registered %s as persistent store backend\n", psi->name);
@@ -667,6 +667,7 @@ void pstore_unregister(struct pstore_info *psi)
free_buf_for_compression();
psinfo = NULL;
+ kfree(backend);
backend = NULL;
mutex_unlock(&psinfo_lock);
}