pstore: Fix NULL pointer fault if get NULL prz in ramoops_get_next_prz
[firefly-linux-kernel-4.4.55.git] / fs / pstore / ram.c
index e0e42b5a691ced15ce979fbd6944028c2010f3a3..d3d37142bd93b49c9e3d6c0b11063d8af17d15f3 100644 (file)
@@ -125,6 +125,8 @@ ramoops_get_next_prz(struct persistent_ram_zone *przs[], uint *c, uint max,
                return NULL;
 
        prz = przs[i];
+       if (!prz)
+               return NULL;
 
        /* Update old/shadowed buffer. */
        if (update)