From: Fengguang Wu Subject: [PATCH] ima: fix coccinelle warnings TO: Mimi Zohar CC: Roberto Sassu CC: linux-kernel@vger.kernel.org security/integrity/ima/ima_template.c:62:41-47: ERROR: application of sizeof to pointer sizeof when applied to a pointer typed expression gives the size of the pointer Generated by: coccinelle/misc/noderef.cocci CC: Roberto Sassu CC: Mimi Zohar Signed-off-by: Fengguang Wu --- cocci-output-13142-271b5e-ima_template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/security/integrity/ima/ima_template.c +++ b/security/integrity/ima/ima_template.c @@ -59,7 +59,7 @@ static int template_desc_init_fields(cha if (template_num_fields > IMA_TEMPLATE_NUM_FIELDS_MAX) return -EINVAL; - *fields = kzalloc(template_num_fields * sizeof(*fields), GFP_KERNEL); + *fields = kzalloc(template_num_fields * sizeof(**fields), GFP_KERNEL); if (*fields == NULL) { result = -ENOMEM; goto out;