Merge tag 'v3.10.68' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / pstore / ram.c
index 546fdc7d3399f6ec80160b39d2065b881d283631..283bda06cd8c19345336d5e76a3e420bc5a20d9d 100644 (file)
@@ -125,13 +125,15 @@ ramoops_get_next_prz(struct persistent_ram_zone *przs[], uint *c, uint max,
                return NULL;
 
        prz = przs[i];
+       if (!prz)
+               return NULL;
 
-       if (update) {
-               /* Update old/shadowed buffer. */
+       /* Update old/shadowed buffer. */
+       if (update)
                persistent_ram_save_old(prz);
-               if (!persistent_ram_old_size(prz))
-                       return NULL;
-       }
+
+       if (!persistent_ram_old_size(prz))
+               return NULL;
 
        *typep = type;
        *id = i;
@@ -386,6 +388,12 @@ static int ramoops_init_prz(struct device *dev, struct ramoops_context *cxt,
        return 0;
 }
 
+void notrace ramoops_console_write_buf(const char *buf, size_t size)
+{
+       struct ramoops_context *cxt = &oops_cxt;
+       persistent_ram_write(cxt->cprz, buf, size);
+}
+
 static int ramoops_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;