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>,
	Andrew Morton <akpm@linux-foundation.org>,
	damon@lists.linux.dev, linux-mm@kvack.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mm/damon/sysfs: eliminate potential uninitialized variable warning
Date: Mon,  6 Nov 2023 16:52:05 +0000	[thread overview]
Message-ID: <20231106165205.48264-1-sj@kernel.org> (raw)
In-Reply-To: <18d2f41d-e442-4f73-89f1-50bf20cd85f2@kadam.mountain>

On Mon, 6 Nov 2023 19:23:47 +0300 Dan Carpenter <dan.carpenter@linaro.org> wrote:

> On Mon, Nov 06, 2023 at 06:41:37AM -0800, SeongJae Park wrote:
> > Hi Dan,
> > 
> > On Mon, 6 Nov 2023 17:07:40 +0300 Dan Carpenter <dan.carpenter@linaro.org> wrote:
> > 
> > > The "err" variable is not initialized if damon_target_has_pid(ctx) is
> > > false and sys_target->regions->nr is zero.
> > 
> > Thank you for fixing this.  I actually noticed this issue from Coverity Weekly
> > Scan of -next tree (CID 1570878), and was about to send very same fix, but you
> > were faster :)
> > 
> > > 
> > > Fixes: 0bcd216c4741 ("mm/damon/sysfs: update monitoring target regions for online input commit")
> > 
> > Cc stable?
> > 
> 
> The fixes tag is from last week so I assumed it wasn't in stable yet.

You're right.  But the broken commit is a fix for stable trees, so I was
thinking this fix should also be merged into the stable kernel together.  I
think stable maintainers would do that on their own, but I wanted to make sure
by explicitly Cc-ing them.

> 
> Also to be honest, I wasn't totally positive this bug could occur in
> real life.

Again, you're right.  The uninitialized value can be returned to the caller,
but the caller of the function is not checking the returned value, so no real
problem can occur here.

But I think the unhandling of the return value is a bug itself, that not making
system crash like things but might make user confused, so I was preparing a
followup fix for that, too.  So, though the problem the fixes will fix are not
significant, I'd prefer merging this and the followup fix to stable trees if
ok, since those are anyway bug fix, and should be simple to apply.  If
something conflicts, I will provide backports.


Thanks,
SJ

> 
> regards,
> dan carpenter

  reply	other threads:[~2023-11-06 16:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-06 14:07 [PATCH] mm/damon/sysfs: eliminate potential uninitialized variable warning Dan Carpenter
2023-11-06 14:41 ` SeongJae Park
2023-11-06 16:23   ` Dan Carpenter
2023-11-06 16:52     ` SeongJae Park [this message]
2023-11-07  3:54       ` Dan Carpenter
2023-11-06 19:05 ` Deepak R Varma
2023-11-06 20:49   ` SeongJae Park

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=20231106165205.48264-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=dan.carpenter@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-mm@kvack.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 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.