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]
Message-Id: <1476774814-6840-2-git-send-email-nobuhiro.iwamatsu.kw@hitachi.com>
Date:   Tue, 18 Oct 2016 16:13:27 +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>,
        Mark Salyzyn <salyzyn@...roid.com>,
        Seiji Aguchi <seiji.aguchi.tr@...achi.com>,
        Shuah Khan <shuahkh@....samsung.com>
Subject: [PATCH v3 1/8] pstore: Replace four kzalloc() calls by kcalloc() in ramoops_init_przs()

The script "checkpatch.pl" can point information out like the following.

    WARNING: Prefer kcalloc over kzalloc with multiply

Thus fix the affected source code places.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@...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:
    New patch.
---
 fs/pstore/ram.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 6ad831b..0bef455 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -424,8 +424,8 @@ static int ramoops_init_przs(struct device *dev, struct ramoops_context *cxt,
 	if (!cxt->max_dump_cnt)
 		return -ENOMEM;
 
-	cxt->przs = kzalloc(sizeof(*cxt->przs) * cxt->max_dump_cnt,
-			     GFP_KERNEL);
+	cxt->przs = kcalloc(cxt->max_dump_cnt, sizeof(*cxt->przs),
+			    GFP_KERNEL);
 	if (!cxt->przs) {
 		dev_err(dev, "failed to initialize a prz array for dumps\n");
 		goto fail_mem;
-- 
2.9.3


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ