All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Dave Chinner <dchinner@redhat.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Chandan Babu R <chandanbabu@kernel.org>,
	"Darrick J. Wong" <djwong@kernel.org>
Subject: fs/xfs/libxfs/xfs_dir2.c:336:15-22: WARNING opportunity for kmemdup
Date: Thu, 26 Dec 2024 04:21:29 +0800	[thread overview]
Message-ID: <202412260425.O3CDUhIi-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9b2ffa6148b1e4468d08f7e0e7e371c43cac9ffe
commit: f078d4ea827607867d42fb3b2ef907caf86ce49d xfs: convert kmem_alloc() to kmalloc()
date:   11 months ago
config: hexagon-randconfig-r064-20241225 (https://download.01.org/0day-ci/archive/20241226/202412260425.O3CDUhIi-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 9daf10ff8f29ba3a88a105aaa9d2379c21b77d35)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412260425.O3CDUhIi-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/xfs/libxfs/xfs_dir2.c:336:15-22: WARNING opportunity for kmemdup

vim +336 fs/xfs/libxfs/xfs_dir2.c

   319	
   320	/*
   321	 * If doing a CI lookup and case-insensitive match, dup actual name into
   322	 * args.value. Return EEXIST for success (ie. name found) or an error.
   323	 */
   324	int
   325	xfs_dir_cilookup_result(
   326		struct xfs_da_args *args,
   327		const unsigned char *name,
   328		int		len)
   329	{
   330		if (args->cmpresult == XFS_CMP_DIFFERENT)
   331			return -ENOENT;
   332		if (args->cmpresult != XFS_CMP_CASE ||
   333						!(args->op_flags & XFS_DA_OP_CILOOKUP))
   334			return -EEXIST;
   335	
 > 336		args->value = kmalloc(len, GFP_NOFS | __GFP_RETRY_MAYFAIL);
   337		if (!args->value)
   338			return -ENOMEM;
   339	
   340		memcpy(args->value, name, len);
   341		args->valuelen = len;
   342		return -EEXIST;
   343	}
   344	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2024-12-25 20:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-25 20:21 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-23 15:08 fs/xfs/libxfs/xfs_dir2.c:336:15-22: WARNING opportunity for kmemdup kernel test robot
2024-03-25  5:01 ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202412260425.O3CDUhIi-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=chandanbabu@kernel.org \
    --cc=dchinner@redhat.com \
    --cc=djwong@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.