Skip to content

Commit 0766af0

Browse files
committed
firmware: arm_ffa: Fix the size of the allocation in ffa_partitions_cleanup()
JIRA: https://issues.redhat.com/browse/RHEL-102691 commit 05857a1 Author: Sudeep Holla <sudeep.holla@arm.com> Date: Tue, 31 Oct 2023 14:13:35 +0000 Arry of pointer to struct ffa_dev_part_info needs to be allocated to fetch the pointers stored in XArray. However, currently we allocate the entire structure instead of just pointers. Fix the allocation size. This will also eliminate the below Smatch istatic checker warning: | drivers/firmware/arm_ffa/driver.c:1251 ffa_partitions_cleanup() | warn: double check that we're allocating correct size: 8 vs 88 Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/all/0e8ddbca-d9da-4a3b-aae3-328993b62ba2@moroto.mountain Link: https://lore.kernel.org/r/20231031141335.3077026-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
1 parent 8d5db9b commit 0766af0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/firmware/arm_ffa/driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ static void ffa_partitions_cleanup(void)
12481248
if (!count)
12491249
return;
12501250

1251-
info = kcalloc(count, sizeof(**info), GFP_KERNEL);
1251+
info = kcalloc(count, sizeof(*info), GFP_KERNEL);
12521252
if (!info)
12531253
return;
12541254

0 commit comments

Comments
 (0)