Skip to content

Commit e976e56

Browse files
toyookakees
authored andcommitted
ramoops: use persistent_ram_free() instead of kfree() for freeing prz
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 <hiraku.toyooka.gu@hitachi.com> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@hitachi.com> Cc: Mark Salyzyn <salyzyn@android.com> Cc: Seiji Aguchi <seiji.aguchi.tr@hitachi.com> Signed-off-by: Kees Cook <keescook@chromium.org>
1 parent 529182e commit e976e56

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/pstore/ram.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,11 @@ static int ramoops_probe(struct platform_device *pdev)
643643
kfree(cxt->pstore.buf);
644644
fail_clear:
645645
cxt->pstore.bufsize = 0;
646-
kfree(cxt->mprz);
646+
persistent_ram_free(cxt->mprz);
647647
fail_init_mprz:
648-
kfree(cxt->fprz);
648+
persistent_ram_free(cxt->fprz);
649649
fail_init_fprz:
650-
kfree(cxt->cprz);
650+
persistent_ram_free(cxt->cprz);
651651
fail_init_cprz:
652652
ramoops_free_przs(cxt);
653653
fail_out:

0 commit comments

Comments
 (0)