summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/pstore/ram.c3
-rw-r--r--fs/pstore/ram_core.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 058f17f0b466..7fd001ccdef4 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -161,6 +161,9 @@ static ssize_t ramoops_pstore_read(u64 *id, enum pstore_type_id *type,
/* ECC correction notice */
ecc_notice_size = persistent_ram_ecc_string(prz, NULL, 0);
+ if (!(size + ecc_notice_size))
+ return 0;
+
*buf = kmalloc(size + ecc_notice_size + 1, GFP_KERNEL);
if (*buf == NULL)
return -ENOMEM;
diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index abafb9b11fea..5b1f222b5044 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -363,7 +363,7 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size)
page_start = start - offset_in_page(start);
page_count = DIV_ROUND_UP(size + offset_in_page(start), PAGE_SIZE);
- prot = pgprot_noncached(PAGE_KERNEL);
+ prot = pgprot_writecombine(PAGE_KERNEL);
pages = kmalloc(sizeof(struct page *) * page_count, GFP_KERNEL);
if (!pages) {