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...@hitachi.com> Cc: Anton Vorontsov <an...@enomsg.org> Cc: Colin Cross <ccr...@android.com> Cc: Kees Cook <keesc...@chromium.org> Cc: Mark Salyzyn <saly...@android.com> Cc: Seiji Aguchi <seiji.aguchi...@hitachi.com> Cc: Shuah Khan <shua...@osg.samsung.com> Cc: Tony Luck <tony.l...@intel.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