All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: SeongJae Park <sj@kernel.org>,
	oe-kbuild@lists.linux.dev, lkp@intel.com,
	oe-kbuild-all@lists.linux.dev
Subject: Re: [sj:damon/next 44/115] mm/damon/sysfs.c:920 damon_sysfs_sample_add_dirs() warn: missing unwind goto?
Date: Wed, 17 Dec 2025 14:22:30 -0800	[thread overview]
Message-ID: <20251217222230.3221-1-sj@kernel.org> (raw)
In-Reply-To: <202512141528.AD9GSzHJ-lkp@intel.com>

On Wed, 17 Dec 2025 19:03:40 +0300 Dan Carpenter <dan.carpenter@linaro.org> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git damon/next
> head:   4daf22e4c21ef13ee2779580295eb0073dc3163b
> commit: f4df9946a1d00c8aa6326f28807efec79af1c2ea [44/115] mm/damon/sysfs: implement sample/filters/ directory
> config: i386-randconfig-141-20251214 (https://download.01.org/0day-ci/archive/20251214/202512141528.AD9GSzHJ-lkp@intel.com/config)
> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> 
> 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>
> | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> | Closes: https://lore.kernel.org/r/202512141528.AD9GSzHJ-lkp@intel.com/
> 
> smatch warnings:
> mm/damon/sysfs.c:920 damon_sysfs_sample_add_dirs() warn: missing unwind goto?
> 
> vim +920 mm/damon/sysfs.c
> 
> 4242d70b872082 SeongJae Park 2025-12-02  901  static int damon_sysfs_sample_add_dirs(
> 4242d70b872082 SeongJae Park 2025-12-02  902  		struct damon_sysfs_sample *sample)
> 4242d70b872082 SeongJae Park 2025-12-02  903  {
> 4242d70b872082 SeongJae Park 2025-12-02  904  	struct damon_sysfs_primitives *primitives;
> f4df9946a1d00c SeongJae Park 2025-12-02  905  	struct damon_sysfs_sample_filters *filters;
> 4242d70b872082 SeongJae Park 2025-12-02  906  	int err;
> 4242d70b872082 SeongJae Park 2025-12-02  907  
> 4242d70b872082 SeongJae Park 2025-12-02  908  	primitives = damon_sysfs_primitives_alloc(true, false);
> 4242d70b872082 SeongJae Park 2025-12-02  909  	if (!primitives)
> 4242d70b872082 SeongJae Park 2025-12-02  910  		return -ENOMEM;
> 4242d70b872082 SeongJae Park 2025-12-02  911  	err = kobject_init_and_add(&primitives->kobj,
> 4242d70b872082 SeongJae Park 2025-12-02  912  			&damon_sysfs_primitives_ktype, &sample->kobj,
> 4242d70b872082 SeongJae Park 2025-12-02  913  			"primitives");
> 4242d70b872082 SeongJae Park 2025-12-02  914  	if (err)
> 4242d70b872082 SeongJae Park 2025-12-02  915  		goto put_primitives_out;
> 4242d70b872082 SeongJae Park 2025-12-02  916  	sample->primitives = primitives;
> 4242d70b872082 SeongJae Park 2025-12-02  917  
> f4df9946a1d00c SeongJae Park 2025-12-02  918  	filters = damon_sysfs_sample_filters_alloc();
> f4df9946a1d00c SeongJae Park 2025-12-02  919  	if (!filters)
> f4df9946a1d00c SeongJae Park 2025-12-02 @920  		return -ENOMEM;
> 
> goto put_primitives_out;?
> 
> f4df9946a1d00c SeongJae Park 2025-12-02  921  	err = kobject_init_and_add(&filters->kobj,
> f4df9946a1d00c SeongJae Park 2025-12-02  922  			&damon_sysfs_sample_filters_ktype, &sample->kobj,
> f4df9946a1d00c SeongJae Park 2025-12-02  923  			"filters");
> f4df9946a1d00c SeongJae Park 2025-12-02  924  	if (err)
> f4df9946a1d00c SeongJae Park 2025-12-02  925  		goto put_filters_out;
> f4df9946a1d00c SeongJae Park 2025-12-02  926  	sample->filters = filters;
> f4df9946a1d00c SeongJae Park 2025-12-02  927  	return 0;
> f4df9946a1d00c SeongJae Park 2025-12-02  928  put_filters_out:
> f4df9946a1d00c SeongJae Park 2025-12-02  929  	kobject_put(&filters->kobj);
> f4df9946a1d00c SeongJae Park 2025-12-02  930  	sample->filters = NULL;
> 4242d70b872082 SeongJae Park 2025-12-02  931  put_primitives_out:
> 4242d70b872082 SeongJae Park 2025-12-02  932  	kobject_put(&primitives->kobj);
> 4242d70b872082 SeongJae Park 2025-12-02  933  	sample->primitives = NULL;
> 4242d70b872082 SeongJae Park 2025-12-02  934  	return err;
> 4242d70b872082 SeongJae Park 2025-12-02  935  }

Thank you for catching this and sharing with me, Dan!  Just pushed a fix that
simply following your suggestion, to damon/next tree.


Thanks,
SJ

[...]

      reply	other threads:[~2025-12-17 22:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-14  7:14 [sj:damon/next 44/115] mm/damon/sysfs.c:920 damon_sysfs_sample_add_dirs() warn: missing unwind goto? kernel test robot
2025-12-17 16:03 ` Dan Carpenter
2025-12-17 22:22 ` SeongJae Park [this message]

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=20251217222230.3221-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@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.