aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-03-03 15:11:40 -0500
committerKees Cook <keescook@chromium.org>2017-03-07 11:21:38 -0500
commit0d7cd09a3dbbdb3d4932cddbef613b2a6de28b75 (patch)
tree7b0b2975a3640de807561f1091476a6c08cd90ee
parent1344dd86f35c7669c94aceb2273676e356cff848 (diff)
pstore: Improve register_pstore() error reporting
Uncommon errors are better to get reported to dmesg so developers can more easily figure out why pstore is unhappy with a backend attempting to register. Signed-off-by: Kees Cook <keescook@chromium.org>
-rw-r--r--fs/pstore/platform.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index d69ef8a840b9..320a673ecb5b 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -673,11 +673,15 @@ int pstore_register(struct pstore_info *psi)
673{ 673{
674 struct module *owner = psi->owner; 674 struct module *owner = psi->owner;
675 675
676 if (backend && strcmp(backend, psi->name)) 676 if (backend && strcmp(backend, psi->name)) {
677 pr_warn("ignoring unexpected backend '%s'\n", psi->name);
677 return -EPERM; 678 return -EPERM;
679 }
678 680
679 spin_lock(&pstore_lock); 681 spin_lock(&pstore_lock);
680 if (psinfo) { 682 if (psinfo) {
683 pr_warn("backend '%s' already loaded: ignoring '%s'\n",
684 psinfo->name, psi->name);
681 spin_unlock(&pstore_lock); 685 spin_unlock(&pstore_lock);
682 return -EBUSY; 686 return -EBUSY;
683 } 687 }