summaryrefslogtreecommitdiffstats
path: root/kernel/fs/pstore/pmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fs/pstore/pmsg.c')
-rw-r--r--kernel/fs/pstore/pmsg.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/fs/pstore/pmsg.c b/kernel/fs/pstore/pmsg.c
index feb5dd294..7de20cd37 100644
--- a/kernel/fs/pstore/pmsg.c
+++ b/kernel/fs/pstore/pmsg.c
@@ -37,6 +37,8 @@ static ssize_t write_pmsg(struct file *file, const char __user *buf,
if (buffer_size > PMSG_MAX_BOUNCE_BUFFER_SIZE)
buffer_size = PMSG_MAX_BOUNCE_BUFFER_SIZE;
buffer = vmalloc(buffer_size);
+ if (!buffer)
+ return -ENOMEM;
mutex_lock(&pmsg_lock);
for (i = 0; i < count; ) {
@@ -112,3 +114,10 @@ err_class:
err:
return;
}
+
+void pstore_unregister_pmsg(void)
+{
+ device_destroy(pmsg_class, MKDEV(pmsg_major, 0));
+ class_destroy(pmsg_class);
+ unregister_chrdev(pmsg_major, PMSG_NAME);
+}