Skip to content

Commit

Permalink
maple_tree: use correct variable type in sizeof
Browse files Browse the repository at this point in the history
The type of variable pointed to by pivs is unsigned long, but the type
used in sizeof is a pointer type.  Change it to unsigned long.

This change has no runtime effect, as sizeof(ul) == sizeof(ul *).

Link: https://lkml.kernel.org/r/[email protected]
Fixes: 54a611b ("Maple Tree: add new data structure")
Signed-off-by: Peng Zhang <[email protected]>
Reported-by: David Binderman <[email protected]>
Reviewed-by: Liam R. Howlett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Peng Zhang authored and akpm00 committed Apr 18, 2023
1 parent d7be6d7 commit fb20e99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/maple_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3258,7 +3258,7 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end

if (tmp < max_p)
memset(pivs + tmp, 0,
sizeof(unsigned long *) * (max_p - tmp));
sizeof(unsigned long) * (max_p - tmp));

if (tmp < mt_slots[mt])
memset(slots + tmp, 0, sizeof(void *) * (max_s - tmp));
Expand Down

0 comments on commit fb20e99

Please sign in to comment.