Commit de7c98eb authored by Markus Elfring's avatar Markus Elfring Committed by Sebastian Reichel

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
parent 0fbad7c8
...@@ -49,7 +49,7 @@ int __init hsi_register_board_info(struct hsi_board_info const *info, ...@@ -49,7 +49,7 @@ int __init hsi_register_board_info(struct hsi_board_info const *info,
{ {
struct hsi_cl_info *cl_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) if (!cl_info)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment