oe-kbuild-all.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>,
	brendan.higgins@linux.dev, davidgow@google.com,
	skhan@linuxfoundation.org, dlatypov@google.com, rmoar@google.com,
	janusz.krzysztofik@linux.intel.com,
	linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev, ruanjinjie@huawei.com
Subject: Re: [PATCH 4/4] kunit: test: Fix the possible memory leak in executor_test
Date: Thu, 14 Sep 2023 22:44:33 +0800	[thread overview]
Message-ID: <202309142251.uJ8saAZv-lkp@intel.com> (raw)
In-Reply-To: <20230914114629.1517650-5-ruanjinjie@huawei.com>

Hi Jinjie,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on next-20230914]
[cannot apply to v6.6-rc1]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jinjie-Ruan/kunit-Fix-missed-memory-release-in-kunit_free_suite_set/20230914-194915
base:   linus/master
patch link:    https://lore.kernel.org/r/20230914114629.1517650-5-ruanjinjie%40huawei.com
patch subject: [PATCH 4/4] kunit: test: Fix the possible memory leak in executor_test
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230914/202309142251.uJ8saAZv-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230914/202309142251.uJ8saAZv-lkp@intel.com/reproduce)

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/202309142251.uJ8saAZv-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from lib/kunit/executor.c:353:
>> lib/kunit/executor_test.c:274:13: warning: 'kfree_at_end' defined but not used [-Wunused-function]
     274 | static void kfree_at_end(struct kunit *test, const void *to_free)
         |             ^~~~~~~~~~~~


vim +/kfree_at_end +274 lib/kunit/executor_test.c

1d71307a6f94df Daniel Latypov 2021-04-20  270  
1d71307a6f94df Daniel Latypov 2021-04-20  271  /* Use the resource API to register a call to kfree(to_free).
1d71307a6f94df Daniel Latypov 2021-04-20  272   * Since we never actually use the resource, it's safe to use on const data.
1d71307a6f94df Daniel Latypov 2021-04-20  273   */
1d71307a6f94df Daniel Latypov 2021-04-20 @274  static void kfree_at_end(struct kunit *test, const void *to_free)
1d71307a6f94df Daniel Latypov 2021-04-20  275  {
1d71307a6f94df Daniel Latypov 2021-04-20  276  	/* kfree() handles NULL already, but avoid allocating a no-op cleanup. */
1d71307a6f94df Daniel Latypov 2021-04-20  277  	if (IS_ERR_OR_NULL(to_free))
1d71307a6f94df Daniel Latypov 2021-04-20  278  		return;
00e63f8afcfc6b David Gow      2023-05-25  279  
00e63f8afcfc6b David Gow      2023-05-25  280  	kunit_add_action(test,
00e63f8afcfc6b David Gow      2023-05-25  281  			(kunit_action_t *)kfree,
1d71307a6f94df Daniel Latypov 2021-04-20  282  			(void *)to_free);
1d71307a6f94df Daniel Latypov 2021-04-20  283  }
1d71307a6f94df Daniel Latypov 2021-04-20  284  

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

           reply	other threads:[~2023-09-14 14:48 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20230914114629.1517650-5-ruanjinjie@huawei.com>]

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=202309142251.uJ8saAZv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=brendan.higgins@linux.dev \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=janusz.krzysztofik@linux.intel.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rmoar@google.com \
    --cc=ruanjinjie@huawei.com \
    --cc=skhan@linuxfoundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).