Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1449279

[PATCH v2 1/5] ramoops: use persistent_ram_free() instead of kfree() for freeing prz

From Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@hitachi.com>
Newsgroups linux.kernel
Subject [PATCH v2 1/5] ramoops: use persistent_ram_free() instead of kfree() for freeing prz
Date 2016-07-25 06:20 +0200
Message-ID <rYFx0-8mq-17@gated-at.bofh.it> (permalink)
References <rYFwZ-8mq-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>

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>
---
 fs/pstore/ram.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index bd9812e..22416c0 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -567,11 +567,11 @@ fail_buf:
 	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:
-- 
2.8.1

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/5] pstore: ramoops: support multiple pmsg instances Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@hitachi.com> - 2016-07-25 06:20 +0200
  [PATCH v2 4/5] ramoops: support multiple pmsg instances Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@hitachi.com> - 2016-07-25 06:20 +0200
  [PATCH v2 1/5] ramoops: use persistent_ram_free() instead of kfree() for freeing prz Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@hitachi.com> - 2016-07-25 06:20 +0200
  [PATCH v2 5/5] selftests/pstore: add testcases for multiple pmsg instances Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@hitachi.com> - 2016-07-25 06:20 +0200

csiph-web