Re: [PATCH v1 2/3] xfs/libxfs: replace kmalloc() and memcpy() with kmemdup()

From: Carlos Maiolino
Date: Tue Jan 14 2025 - 05:29:07 EST


On Tue, 17 Dec 2024 23:58:12 +0100, Mirsad Todorovac wrote:
> The source static analysis tool gave the following advice:
>
> ./fs/xfs/libxfs/xfs_dir2.c:382:15-22: WARNING opportunity for kmemdup
>
> → 382 args->value = kmalloc(len,
> 383 GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_RETRY_MAYFAIL);
> 384 if (!args->value)
> 385 return -ENOMEM;
> 386
> → 387 memcpy(args->value, name, len);
> 388 args->valuelen = len;
> 389 return -EEXIST;
>
> [...]

Applied to for-next, thanks!

[2/3] xfs/libxfs: replace kmalloc() and memcpy() with kmemdup()
commit: 9d9b72472631262b35157f1a650f066c0e11c2bb

Best regards,
--
Carlos Maiolino <cem@xxxxxxxxxx>