mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
firmware: arm_ffa: Fix the size of the allocation in ffa_partitions_cleanup()
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>
This commit is contained in:
parent
6d67cbe67a
commit
05857a1eb7
|
|
@ -1248,7 +1248,7 @@ static void ffa_partitions_cleanup(void)
|
|||
if (!count)
|
||||
return;
|
||||
|
||||
info = kcalloc(count, sizeof(**info), GFP_KERNEL);
|
||||
info = kcalloc(count, sizeof(*info), GFP_KERNEL);
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user