Skip to content

Commit

Permalink
ramoops: use persistent_ram_free() instead of kfree() for freeing prz
Browse files Browse the repository at this point in the history
persistent_ram_zone(=prz) structures are allocated by persistent_ram_new(),
which includes vmap() or ioremap(). But they are currently freed by
kfree(). This uses persistent_ram_free() for correct this asymmetry usage.

Signed-off-by: Hiraku Toyooka <[email protected]>
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
Cc: Mark Salyzyn <[email protected]>
Cc: Seiji Aguchi <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
toyooka authored and kees committed Aug 5, 2016
1 parent 529182e commit e976e56
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/pstore/ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,11 +643,11 @@ static int ramoops_probe(struct platform_device *pdev)
kfree(cxt->pstore.buf);
fail_clear:
cxt->pstore.bufsize = 0;
kfree(cxt->mprz);
persistent_ram_free(cxt->mprz);
fail_init_mprz:
kfree(cxt->fprz);
persistent_ram_free(cxt->fprz);
fail_init_fprz:
kfree(cxt->cprz);
persistent_ram_free(cxt->cprz);
fail_init_cprz:
ramoops_free_przs(cxt);
fail_out:
Expand Down

0 comments on commit e976e56

Please sign in to comment.