Skip to content

Commit a3fab95

Browse files
committed
dm: dm-zoned: Adjust dmz_load_mapping() allocation type
In preparation for making the kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.) The assigned type is "struct dmz_mblock **" but the returned type will be "struct dmz_mblk **". These are the same allocation size (pointer size), but the types do not match. Adjust the allocation type to match the assignment. Link: https://patch.msgid.link/20250426061707.work.587-kees@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
1 parent c6fcccd commit a3fab95

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/md/dm-zoned-metadata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ static int dmz_load_mapping(struct dmz_metadata *zmd)
16871687

16881688
/* Metadata block array for the chunk mapping table */
16891689
zmd->map_mblk = kcalloc(zmd->nr_map_blocks,
1690-
sizeof(struct dmz_mblk *), GFP_KERNEL);
1690+
sizeof(struct dmz_mblock *), GFP_KERNEL);
16911691
if (!zmd->map_mblk)
16921692
return -ENOMEM;
16931693

0 commit comments

Comments
 (0)