From: Markus Elfring Date: Tue, 25 Apr 2017 11:56:08 +0000 (+0200) Subject: HSI: Use kcalloc() in hsi_register_board_info() X-Git-Tag: v4.13-rc1~171^2~1 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=de7c98eb7c6f72bbfa87afc5b7e2d3b0188a8d83;p=linux.git HSI: Use kcalloc() in hsi_register_board_info() A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kcalloc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Sebastian Reichel --- diff --git a/drivers/hsi/hsi_boardinfo.c b/drivers/hsi/hsi_boardinfo.c index e56bc6da5f98..e381cb4c962e 100644 --- a/drivers/hsi/hsi_boardinfo.c +++ b/drivers/hsi/hsi_boardinfo.c @@ -49,7 +49,7 @@ int __init hsi_register_board_info(struct hsi_board_info const *info, { struct hsi_cl_info *cl_info; - cl_info = kzalloc(sizeof(*cl_info) * len, GFP_KERNEL); + cl_info = kcalloc(len, sizeof(*cl_info), GFP_KERNEL); if (!cl_info) return -ENOMEM;