Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
[deliverable/linux.git] / drivers / acpi / apei / erst.c
index a9cf96085f85bc4523851b974ab09333a96fb407..88d0b0f9f92b73706e330e62a4bcf70dd4b0befa 100644 (file)
@@ -1180,20 +1180,28 @@ static int __init erst_init(void)
        if (!erst_erange.vaddr)
                goto err_release_erange;
 
+       pr_info(ERST_PFX
+       "Error Record Serialization Table (ERST) support is initialized.\n");
+
        buf = kmalloc(erst_erange.size, GFP_KERNEL);
        spin_lock_init(&erst_info.buf_lock);
        if (buf) {
                erst_info.buf = buf + sizeof(struct cper_pstore_record);
                erst_info.bufsize = erst_erange.size -
                                    sizeof(struct cper_pstore_record);
-               if (pstore_register(&erst_info)) {
-                       pr_info(ERST_PFX "Could not register with persistent store\n");
+               rc = pstore_register(&erst_info);
+               if (rc) {
+                       if (rc != -EPERM)
+                               pr_info(ERST_PFX
+                               "Could not register with persistent store\n");
+                       erst_info.buf = NULL;
+                       erst_info.bufsize = 0;
                        kfree(buf);
                }
-       }
-
-       pr_info(ERST_PFX
-       "Error Record Serialization Table (ERST) support is initialized.\n");
+       } else
+               pr_err(ERST_PFX
+               "Failed to allocate %lld bytes for persistent store error log\n",
+               erst_erange.size);
 
        return 0;
 
This page took 0.025643 seconds and 5 git commands to generate.