diff options
| author | Mirsad Todorovac <[email protected]> | 2024-12-17 22:58:12 +0000 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2025-01-13 13:58:04 +0000 |
| commit | 9d9b72472631262b35157f1a650f066c0e11c2bb (patch) | |
| tree | 20ee31e90cf7c66a31b1ccc528741af8f14bbe7d /fs/xfs/xfs_exchrange.c | |
| parent | xfs: constify feature checks (diff) | |
| download | kernel-9d9b72472631262b35157f1a650f066c0e11c2bb.tar.gz kernel-9d9b72472631262b35157f1a650f066c0e11c2bb.zip | |
xfs/libxfs: replace kmalloc() and memcpy() with kmemdup()
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;
Replacing kmalloc() + memcpy() with kmemdump() doesn't change semantics.
Original code works without fault, so this is not a bug fix but proposed improvement.
Link: https://lwn.net/Articles/198928/
Fixes: 94a69db2367ef ("xfs: use __GFP_NOLOCKDEP instead of GFP_NOFS")
Fixes: 384f3ced07efd ("[XFS] Return case-insensitive match for dentry cache")
Fixes: 2451337dd0439 ("xfs: global error sign conversion")
Cc: Carlos Maiolino <[email protected]>
Cc: Darrick J. Wong <[email protected]>
Cc: Chandan Babu R <[email protected]>
Cc: Dave Chinner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Reviewed-by: "Darrick J. Wong" <[email protected]>
Signed-off-by: Mirsad Todorovac <[email protected]>
Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'fs/xfs/xfs_exchrange.c')
0 files changed, 0 insertions, 0 deletions
