All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [fdmanana:misc-next 2/7] fs/btrfs/send.c:3854:8-15: WARNING opportunity for kmemdup
@ 2020-10-13  2:13 kernel test robot
  2020-10-13  2:13 ` [PATCH] btrfs: fix memdup.cocci warnings kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2020-10-13  2:13 UTC (permalink / raw
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 968 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Filipe Manana <fdmanana@suse.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git misc-next
head:   fdde80f42dc3e822ab990d28d584175eb0ca222f
commit: 28314eb24e6cb8124d1e5da2ef2ccb90ec44cc06 [2/7] btrfs: send, recompute reference path after orphanization of a directory
:::::: branch date: 15 hours ago
:::::: commit date: 3 weeks ago
config: powerpc-randconfig-c003-20201013 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


"coccinelle warnings: (new ones prefixed by >>)"
>> fs/btrfs/send.c:3854:8-15: WARNING opportunity for kmemdup

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30017 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] btrfs: fix memdup.cocci warnings
  2020-10-13  2:13 [fdmanana:misc-next 2/7] fs/btrfs/send.c:3854:8-15: WARNING opportunity for kmemdup kernel test robot
@ 2020-10-13  2:13 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-10-13  2:13 UTC (permalink / raw
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Filipe Manana <fdmanana@suse.com>
CC: Chris Mason <chris.mason@fusionio.com>
CC: Josef Bacik <josef@toxicpanda.com>
CC: David Sterba <dsterba@suse.com>
CC: linux-btrfs(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

fs/btrfs/send.c:3854:8-15: WARNING opportunity for kmemdup

 Use kmemdup rather than duplicating its implementation

Generated by: scripts/coccinelle/api/memdup.cocci

Fixes: 28314eb24e6c ("btrfs: send, recompute reference path after orphanization of a directory")
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/fdmanana/linux.git misc-next
head:   fdde80f42dc3e822ab990d28d584175eb0ca222f
commit: 28314eb24e6cb8124d1e5da2ef2ccb90ec44cc06 [2/7] btrfs: send, recompute reference path after orphanization of a directory
:::::: branch date: 15 hours ago
:::::: commit date: 3 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 send.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -3851,10 +3851,9 @@ static int refresh_ref_path(struct send_
 	char *name;
 	int ret;
 
-	name = kmalloc(ref->name_len, GFP_KERNEL);
+	name = kmemdup(ref->name, ref->name_len, GFP_KERNEL);
 	if (!name)
 		return -ENOMEM;
-	memcpy(name, ref->name, ref->name_len);
 
 	fs_path_reset(ref->full_path);
 	ret = get_cur_path(sctx, ref->dir, ref->dir_gen, ref->full_path);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-13  2:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-13  2:13 [fdmanana:misc-next 2/7] fs/btrfs/send.c:3854:8-15: WARNING opportunity for kmemdup kernel test robot
2020-10-13  2:13 ` [PATCH] btrfs: fix memdup.cocci warnings kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.