summaryrefslogtreecommitdiff
path: root/fs/pstore/ram.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/pstore/ram.c')
-rw-r--r--fs/pstore/ram.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 0b36e91978e6..58b93fbd117e 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -260,7 +260,7 @@ static void ramoops_free_przs(struct ramoops_context *cxt)
if (!cxt->przs)
return;
- for (i = 0; cxt->przs[i]; i++)
+ for (i = 0; !IS_ERR_OR_NULL(cxt->przs[i]); i++)
persistent_ram_free(cxt->przs[i]);
kfree(cxt->przs);
}