mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
xfs: use kmalloc_objs() instead of kmalloc() in xfs_da_grow_inode_int
Convert open-coded kmalloc() multiplication to the modern kmalloc_objs() interface to improve type safety and prevent potential integer overflows. No functional changes are intended. Signed-off-by: Cihan Karadag <cihan.cihan@gmail.com> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
c6c54d05b1
commit
56aa9ef3c4
|
|
@ -2354,8 +2354,7 @@ xfs_da_grow_inode_int(
|
|||
* If we didn't get it and the block might work if fragmented,
|
||||
* try without the CONTIG flag. Loop until we get it all.
|
||||
*/
|
||||
mapp = kmalloc(sizeof(*mapp) * count,
|
||||
GFP_KERNEL | __GFP_NOFAIL);
|
||||
mapp = kmalloc_objs(*mapp, count, GFP_KERNEL | __GFP_NOFAIL);
|
||||
for (b = *bno, mapi = 0; b < *bno + count; ) {
|
||||
c = (int)(*bno + count - b);
|
||||
nmap = min(XFS_BMAP_MAX_NMAP, c);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user