lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 18 Oct 2016 16:13:28 +0900
From:   Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@...achi.com>
To:     Anton Vorontsov <anton@...msg.org>,
        Colin Cross <ccross@...roid.com>,
        Kees Cook <keescook@...omium.org>,
        Tony Luck <tony.luck@...el.com>
Cc:     linux-kernel@...r.kernel.org,
        cti.systems-productivity-manager.ts@...achi.com,
        Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@...achi.com>,
        Hiraku Toyooka <hiraku.toyooka.gu@...achi.com>,
        Mark Salyzyn <salyzyn@...roid.com>,
        Seiji Aguchi <seiji.aguchi.tr@...achi.com>,
        Shuah Khan <shuahkh@....samsung.com>
Subject: [PATCH v3 2/8] pstore: Change parameter of ramoops_free_przs()

This commit changes parameter of ramoops_free_przs() from
struct ramoops_context * into struct persistent_ram_zone * in order to
make it available for all prz array.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@...achi.com>
Signed-off-by: Hiraku Toyooka <hiraku.toyooka.gu@...achi.com>
Cc: Anton Vorontsov <anton@...msg.org>
Cc: Colin Cross <ccross@...roid.com>
Cc: Kees Cook <keescook@...omium.org>
Cc: Mark Salyzyn <salyzyn@...roid.com>
Cc: Seiji Aguchi <seiji.aguchi.tr@...achi.com>
Cc: Shuah Khan <shuahkh@....samsung.com>
Cc: Tony Luck <tony.luck@...el.com>

V3:
   - Split patch.
   - Rebase.
---
 fs/pstore/ram.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 0bef455..691680f 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -392,18 +392,16 @@ static struct ramoops_context oops_cxt = {
 	},
 };
 
-static void ramoops_free_przs(struct ramoops_context *cxt)
+static void ramoops_free_przs(struct persistent_ram_zone **przs, int cnt)
 {
 	int i;
 
-	if (!cxt->przs)
+	if (!przs)
 		return;
 
-	for (i = 0; i < cxt->max_dump_cnt; i++)
-		persistent_ram_free(cxt->przs[i]);
-
-	kfree(cxt->przs);
-	cxt->max_dump_cnt = 0;
+	for (i = 0; i < cnt; i++)
+		persistent_ram_free(przs[i]);
+	kfree(przs);
 }
 
 static int ramoops_init_przs(struct device *dev, struct ramoops_context *cxt,
@@ -684,7 +682,8 @@ static int ramoops_probe(struct platform_device *pdev)
 fail_init_fprz:
 	persistent_ram_free(cxt->cprz);
 fail_init_cprz:
-	ramoops_free_przs(cxt);
+	ramoops_free_przs(cxt->przs, cxt->max_dump_cnt);
+	cxt->max_dump_cnt = 0;
 fail_out:
 	return err;
 }
@@ -701,7 +700,8 @@ static int ramoops_remove(struct platform_device *pdev)
 	persistent_ram_free(cxt->mprz);
 	persistent_ram_free(cxt->fprz);
 	persistent_ram_free(cxt->cprz);
-	ramoops_free_przs(cxt);
+	ramoops_free_przs(cxt->przs, cxt->max_dump_cnt);
+	cxt->max_dump_cnt = 0;
 
 	return 0;
 }
-- 
2.9.3


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ