aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/pstore/ram.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 6f96d8c2a711..3b5744306ed8 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -320,6 +320,7 @@ static void ramoops_free_przs(struct ramoops_context *cxt)
320{ 320{
321 int i; 321 int i;
322 322
323 cxt->max_dump_cnt = 0;
323 if (!cxt->przs) 324 if (!cxt->przs)
324 return; 325 return;
325 326
@@ -350,7 +351,7 @@ static int ramoops_init_przs(struct device *dev, struct ramoops_context *cxt,
350 GFP_KERNEL); 351 GFP_KERNEL);
351 if (!cxt->przs) { 352 if (!cxt->przs) {
352 dev_err(dev, "failed to initialize a prz array for dumps\n"); 353 dev_err(dev, "failed to initialize a prz array for dumps\n");
353 return -ENOMEM; 354 goto fail_prz;
354 } 355 }
355 356
356 for (i = 0; i < cxt->max_dump_cnt; i++) { 357 for (i = 0; i < cxt->max_dump_cnt; i++) {
@@ -508,7 +509,6 @@ fail_buf:
508 kfree(cxt->pstore.buf); 509 kfree(cxt->pstore.buf);
509fail_clear: 510fail_clear:
510 cxt->pstore.bufsize = 0; 511 cxt->pstore.bufsize = 0;
511 cxt->max_dump_cnt = 0;
512fail_cnt: 512fail_cnt:
513 kfree(cxt->fprz); 513 kfree(cxt->fprz);
514fail_init_fprz: 514fail_init_fprz: